@productcraft/mail 0.3.0 → 1.0.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.
@@ -0,0 +1,2383 @@
1
+ 'use strict';
2
+
3
+ // src/_generated/testing.ts
4
+ var ROUTES = [
5
+ { op: "integrations.github.settings.update", method: "PUT", pattern: /^\/v1\/workspaces\/[^\/]+\/integrations\/github\/settings$/, status: 204, contentType: null, body: null },
6
+ { op: "integrations.github.connect", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/integrations\/github\/connect$/, status: 200, contentType: "application/json", body: {
7
+ authorize_url: "https://github.com/login/oauth/authorize?client_id=\u2026&state=\u2026&redirect_uri=\u2026"
8
+ } },
9
+ { op: "integrations.github.repos.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/integrations\/github\/repos$/, status: 200, contentType: "application/json", body: [
10
+ {
11
+ default_branch: "string",
12
+ full_name: "string",
13
+ html_url: "https://example.com",
14
+ private: true,
15
+ updated_at: "2026-01-01T00:00:00.000Z"
16
+ }
17
+ ] },
18
+ { op: "integrations.github.sync.create", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/integrations\/github\/sync$/, status: 202, contentType: "application/json", body: { started_at: "2026-01-01T00:00:00.000Z", sync_id: "string" } },
19
+ { op: "smtpConfig.verifySaved", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/smtp-config\/verify-saved$/, status: 200, contentType: "application/json", body: {
20
+ error: { code: "EAUTH", message: "Authentication failed \u2014 check the username and password." },
21
+ ok: true
22
+ } },
23
+ { op: "webhooks.eventTypes.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/webhooks\/event-types$/, status: 200, contentType: "application/json", body: {
24
+ data: [
25
+ {
26
+ category: "Users",
27
+ description: "A user signed up or was created by an admin.",
28
+ emitted: true,
29
+ example: {},
30
+ legacy_alias: "message.bounced",
31
+ type: "email.sent"
32
+ }
33
+ ]
34
+ } },
35
+ { op: "broadcasts.audience", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/broadcasts\/audience$/, status: 200, contentType: "application/json", body: { computed_at: "2026-01-01T00:00:00.000Z", recipients: 1180, segment_contacts: 1240 } },
36
+ { op: "broadcasts.settings.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/broadcast-settings$/, status: 200, contentType: "application/json", body: { default_rate_per_minute: 120, effective_rate_per_minute: 120, rate_per_minute: 1 } },
37
+ { op: "broadcasts.settings.update", method: "PUT", pattern: /^\/v1\/workspaces\/[^\/]+\/broadcast-settings$/, status: 200, contentType: "application/json", body: { default_rate_per_minute: 120, effective_rate_per_minute: 120, rate_per_minute: 1 } },
38
+ { op: "contacts.properties.create", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/contact-properties$/, status: 201, contentType: "application/json", body: {
39
+ created_at: "2026-01-01T00:00:00.000Z",
40
+ fallback_value: "string",
41
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
42
+ key: "company",
43
+ type: "string",
44
+ updated_at: "2026-01-01T00:00:00.000Z"
45
+ } },
46
+ { op: "contacts.properties.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/contact-properties$/, status: 200, contentType: "application/json", body: {
47
+ data: [
48
+ {
49
+ created_at: "2026-01-01T00:00:00.000Z",
50
+ fallback_value: "string",
51
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
52
+ key: "company",
53
+ type: "string",
54
+ updated_at: "2026-01-01T00:00:00.000Z"
55
+ }
56
+ ],
57
+ pagination: { next_cursor: null, has_more: false }
58
+ } },
59
+ { op: "smtpConfig.verify", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/smtp-config\/verify$/, status: 200, contentType: "application/json", body: {
60
+ error: { code: "EAUTH", message: "Authentication failed \u2014 check the username and password." },
61
+ ok: true
62
+ } },
63
+ { op: "webhooks.endpoints.create", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/webhooks\/endpoints$/, status: 201, contentType: "application/json", body: {
64
+ consecutive_failures: 1,
65
+ created_at: "2026-01-01T00:00:00.000Z",
66
+ description: "Production receiver",
67
+ disabled_at: "2026-01-01T00:00:00.000Z",
68
+ disabled_reason: "manual",
69
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
70
+ enabled: true,
71
+ event_types: [],
72
+ events: ["email.delivered"],
73
+ first_failure_at: "2026-01-01T00:00:00.000Z",
74
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
75
+ legacy_signature: true,
76
+ legacy_slot: "default",
77
+ prev_signing_secret_active: true,
78
+ prev_signing_secret_expires_at: "2026-01-01T00:00:00.000Z",
79
+ scope_id: "string",
80
+ scope_type: "workspace",
81
+ signing_secret: "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw",
82
+ signing_secret_hint: "x9Q=",
83
+ status: "enabled",
84
+ updated_at: "2026-01-01T00:00:00.000Z",
85
+ url: "https://api.acme.com/webhooks"
86
+ } },
87
+ { op: "webhooks.endpoints.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/webhooks\/endpoints$/, status: 200, contentType: "application/json", body: {
88
+ data: [
89
+ {
90
+ consecutive_failures: 1,
91
+ created_at: "2026-01-01T00:00:00.000Z",
92
+ description: "Production receiver",
93
+ disabled_at: "2026-01-01T00:00:00.000Z",
94
+ disabled_reason: "manual",
95
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
96
+ enabled: true,
97
+ event_types: [],
98
+ events: ["email.delivered"],
99
+ first_failure_at: "2026-01-01T00:00:00.000Z",
100
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
101
+ legacy_signature: true,
102
+ legacy_slot: "default",
103
+ prev_signing_secret_active: true,
104
+ prev_signing_secret_expires_at: "2026-01-01T00:00:00.000Z",
105
+ scope_id: "string",
106
+ scope_type: "workspace",
107
+ signing_secret_hint: "x9Q=",
108
+ status: "enabled",
109
+ updated_at: "2026-01-01T00:00:00.000Z",
110
+ url: "https://api.acme.com/webhooks"
111
+ }
112
+ ],
113
+ pagination: { next_cursor: null, has_more: false }
114
+ } },
115
+ { op: "messages.settings.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/messages\/settings$/, status: 200, contentType: "application/json", body: { redact_bodies: true, workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b" } },
116
+ { op: "messages.settings.update", method: "PATCH", pattern: /^\/v1\/workspaces\/[^\/]+\/messages\/settings$/, status: 200, contentType: "application/json", body: { redact_bodies: true, workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b" } },
117
+ { op: "messages.timeline", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/messages\/timeline$/, status: 200, contentType: "application/json", body: { granularity: "day", metric: "sent", points: [{ count: 42, date: "2026-04-02" }] } },
118
+ { op: "templates.preview", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/templates\/preview$/, status: 200, contentType: "application/json", body: { html: "string", subject: "string", text: "string" } },
119
+ { op: "webhooks.attempts.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/webhooks\/attempts$/, status: 200, contentType: "application/json", body: {
120
+ data: [
121
+ {
122
+ attempt_number: 1,
123
+ attempted_at: "2026-01-01T00:00:00.000Z",
124
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
125
+ endpoint_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
126
+ error_message: "string",
127
+ event_id: "evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f",
128
+ event_type: "email.bounced",
129
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
130
+ latency_ms: 1,
131
+ response_body_truncated: "string",
132
+ status_code: 1,
133
+ url: "https://example.com"
134
+ }
135
+ ],
136
+ pagination: { next_cursor: null, has_more: false }
137
+ } },
138
+ { op: "contacts.imports.create", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/contacts\/imports$/, status: 202, contentType: "application/json", body: {
139
+ completed_at: "2026-01-01T00:00:00.000Z",
140
+ consent_source: "string",
141
+ consented_count: 1,
142
+ created_at: "2026-01-01T00:00:00.000Z",
143
+ created_count: 1,
144
+ error_count: 1,
145
+ errors: [{ error: "invalid or missing email", line: 1 }],
146
+ failure_reason: "string",
147
+ filename: "string",
148
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
149
+ on_conflict: "upsert",
150
+ processed_rows: 1,
151
+ size_bytes: 1,
152
+ skipped_count: 1,
153
+ started_at: "2026-01-01T00:00:00.000Z",
154
+ status: "queued",
155
+ topic_ids: ["9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"],
156
+ total_rows: 1,
157
+ updated_count: 1
158
+ } },
159
+ { op: "contacts.imports.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/contacts\/imports$/, status: 200, contentType: "application/json", body: {
160
+ data: [
161
+ {
162
+ completed_at: "2026-01-01T00:00:00.000Z",
163
+ consent_source: "string",
164
+ consented_count: 1,
165
+ created_at: "2026-01-01T00:00:00.000Z",
166
+ created_count: 1,
167
+ error_count: 1,
168
+ errors: [{ error: "invalid or missing email", line: 1 }],
169
+ failure_reason: "string",
170
+ filename: "string",
171
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
172
+ on_conflict: "upsert",
173
+ processed_rows: 1,
174
+ size_bytes: 1,
175
+ skipped_count: 1,
176
+ started_at: "2026-01-01T00:00:00.000Z",
177
+ status: "queued",
178
+ topic_ids: ["9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"],
179
+ total_rows: 1,
180
+ updated_count: 1
181
+ }
182
+ ],
183
+ pagination: { next_cursor: null, has_more: false }
184
+ } },
185
+ { op: "segments.preview", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/segments\/preview$/, status: 200, contentType: "application/json", body: {
186
+ metrics: {
187
+ computed_at: "2026-01-01T00:00:00.000Z",
188
+ consented_count: 1100,
189
+ contact_count: 1240,
190
+ segment_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
191
+ unsubscribed_count: 31,
192
+ unsubscribed_share: 0.025
193
+ },
194
+ sample: [
195
+ {
196
+ consent_source: "signup-form-2026",
197
+ consented_at: "2026-01-01T00:00:00.000Z",
198
+ created_at: "2026-01-01T00:00:00.000Z",
199
+ created_via: "api",
200
+ email: "ada@example.com",
201
+ first_name: "string",
202
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
203
+ last_name: "string",
204
+ properties: { company: "Acme" },
205
+ unsubscribed: true,
206
+ unsubscribed_at: "2026-01-01T00:00:00.000Z",
207
+ updated_at: "2026-01-01T00:00:00.000Z"
208
+ }
209
+ ]
210
+ } },
211
+ { op: "sendingDefaults.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/sending-defaults$/, status: 200, contentType: "application/json", body: {
212
+ default_sender: {
213
+ address: "Acme <hello@acme.com>",
214
+ domain_id: "5e1f3a2b-8c4d-4e6f-9a0b-1c2d3e4f5a6b",
215
+ domain_status: "verified",
216
+ verified: true
217
+ },
218
+ skipped_sends: { count: 0, last_at: null, last_template: null },
219
+ updated_at: "2026-10-17T09:30:00.000Z"
220
+ } },
221
+ { op: "sendingDefaults.update", method: "PUT", pattern: /^\/v1\/workspaces\/[^\/]+\/sending-defaults$/, status: 200, contentType: "application/json", body: {
222
+ default_sender: {
223
+ address: "Acme <hello@acme.com>",
224
+ domain_id: "5e1f3a2b-8c4d-4e6f-9a0b-1c2d3e4f5a6b",
225
+ domain_status: "verified",
226
+ verified: true
227
+ },
228
+ skipped_sends: { count: 0, last_at: null, last_template: null },
229
+ updated_at: "2026-10-17T09:30:00.000Z"
230
+ } },
231
+ { op: "messages.export", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/messages\/export$/, status: 200, contentType: "text/csv", body: "" },
232
+ { op: "received.export", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/received\/export$/, status: 200, contentType: "text/csv", body: "" },
233
+ { op: "webhooks.events.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/webhooks\/events$/, status: 200, contentType: "application/json", body: {
234
+ data: [
235
+ {
236
+ created_at: "2026-01-01T00:00:00.000Z",
237
+ deliveries: [
238
+ {
239
+ attempt_number: 1,
240
+ attempted_at: "2026-01-01T00:00:00.000Z",
241
+ endpoint_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
242
+ next_attempt_at: "2026-01-01T00:00:00.000Z",
243
+ status_code: 1,
244
+ succeeded: true
245
+ }
246
+ ],
247
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
248
+ email_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
249
+ id: "evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f",
250
+ payload: {},
251
+ status: "pending",
252
+ test: true,
253
+ type: "email.sent"
254
+ }
255
+ ],
256
+ pagination: { next_cursor: null, has_more: false }
257
+ } },
258
+ { op: "deliverability.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/deliverability$/, status: 200, contentType: "application/json", body: {
259
+ block_signals: [{ count: 37, detail: "554 5.7.1 Blocked using Proofpoint Dynamic Reputation" }],
260
+ bounced: 7,
261
+ confirmed: 0,
262
+ confirmed_rate: 0,
263
+ deferred: 235,
264
+ domains: [
265
+ {
266
+ dmarc: {
267
+ adkim: "r",
268
+ aspf: "r",
269
+ domain_policy: "none",
270
+ host: "_dmarc.example.com",
271
+ location: "subdomain",
272
+ pct: 100,
273
+ policy: "none",
274
+ record: "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com",
275
+ rua: ["mailto:dmarc@example.com"],
276
+ subdomain_policy: "none",
277
+ warning: "string"
278
+ },
279
+ fqdn: "mail.example.com",
280
+ status: "pending"
281
+ }
282
+ ],
283
+ left_queue: 80,
284
+ negative: 7,
285
+ negative_rate: 0.0875,
286
+ queued: 0,
287
+ summary: "80 message(s) were handed off and none has been confirmed as arriving.",
288
+ verdict: "unconfirmed",
289
+ window_days: 14
290
+ } },
291
+ { op: "domains.lookup", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/domains\/lookup$/, status: 200, contentType: "application/json", body: {
292
+ domain_connect: {
293
+ available: true,
294
+ provider_id: "cloudflare.com",
295
+ provider_name: "Cloudflare",
296
+ reason: "no_record",
297
+ supported: true
298
+ },
299
+ existing: {
300
+ dkim_selector_taken: true,
301
+ dmarc: { host: "_dmarc.acme.com", record: "v=DMARC1; p=none" },
302
+ mx: ["10 aspmx.l.google.com"],
303
+ spf: [{ host: "acme.com", record: "v=spf1 include:_spf.google.com ~all" }]
304
+ },
305
+ fqdn: "acme.com",
306
+ provider: {
307
+ id: "cloudflare",
308
+ name: "Cloudflare",
309
+ nameservers: ["ns1.digitalocean.com", "ns2.digitalocean.com"],
310
+ source: "ns"
311
+ },
312
+ suggestion: { fqdn: "mail.acme.com", reason: "string" },
313
+ zone: "acme.com"
314
+ } },
315
+ { op: "emails.metrics", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/emails\/metrics$/, status: 200, contentType: "application/json", body: {
316
+ bounce_source: "ses",
317
+ data: [
318
+ {
319
+ bounce_rate: 0.0185,
320
+ bounced: 12,
321
+ complained: 1,
322
+ complaint_rate: 1e-4,
323
+ deferred: 3,
324
+ delivered: 1240,
325
+ delivery_rate: 0.974,
326
+ domain_id: "3f6b2a1e-8c4d-4e5f-9a0b-1c2d3e4f5a6b",
327
+ domain_name: "mail.example.com",
328
+ failed: 0,
329
+ period: "2026-10-12T00:00:00+01:00",
330
+ sent: 29037,
331
+ suppressed: 5,
332
+ tracked: 1273,
333
+ unconfirmed: 60
334
+ }
335
+ ],
336
+ end_date: "2026-10-12T15:00:00+01:00",
337
+ granularity: "daily",
338
+ measured: { complaint: true, delivery: true },
339
+ object: "metrics",
340
+ start_date: "2026-10-06T00:00:00+01:00",
341
+ timezone: "Europe/Lisbon",
342
+ totals: {
343
+ bounce_rate: 0.0185,
344
+ bounced: 12,
345
+ complained: 1,
346
+ complaint_rate: 1e-4,
347
+ deferred: 3,
348
+ delivered: 1240,
349
+ delivery_rate: 0.974,
350
+ failed: 0,
351
+ sent: 29037,
352
+ suppressed: 5,
353
+ tracked: 1273,
354
+ unconfirmed: 60
355
+ }
356
+ } },
357
+ { op: "templates.lint", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/templates\/lint$/, status: 200, contentType: "application/json", body: {
358
+ findings: [{ id: "string", message: "string", severity: "error", suggestion: "string" }],
359
+ score: 1
360
+ } },
361
+ { op: "templates.tags.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/templates\/tags$/, status: 200, contentType: "application/json", body: { data: ["string"] } },
362
+ { op: "emails.batch", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/emails\/batch$/, status: 200, contentType: "application/json", body: {
363
+ data: [
364
+ {
365
+ error: { code: "string", message: "string" },
366
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
367
+ index: 1,
368
+ status: "accepted"
369
+ }
370
+ ],
371
+ summary: { accepted: 1, rejected: 1 }
372
+ } },
373
+ { op: "integrations.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/integrations$/, status: 200, contentType: "application/json", body: {
374
+ data: [
375
+ {
376
+ account_avatar_url: "https://avatars.githubusercontent.com/u/1?v=4",
377
+ account_login: "octocat",
378
+ display_name: "GitHub",
379
+ last_error: "string",
380
+ last_synced_at: "2026-01-01T00:00:00.000Z",
381
+ provider: "github",
382
+ settings: {},
383
+ status: "active",
384
+ updated_at: "2026-01-01T00:00:00.000Z"
385
+ }
386
+ ]
387
+ } },
388
+ { op: "smtpConfig.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/smtp-configs$/, status: 200, contentType: "application/json", body: {
389
+ data: [
390
+ {
391
+ created_at: "2026-01-01T00:00:00.000Z",
392
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
393
+ from_email: "ada@example.com",
394
+ from_name: "string",
395
+ host: "string",
396
+ last_verified_at: "2026-01-01T00:00:00.000Z",
397
+ last_verify_error: "string",
398
+ password: "string",
399
+ password_set: true,
400
+ port: 1,
401
+ secure: true,
402
+ status: "pending",
403
+ updated_at: "2026-01-01T00:00:00.000Z",
404
+ username: "string",
405
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
406
+ }
407
+ ]
408
+ } },
409
+ { op: "smtpConfig.reset", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/smtp-config$/, status: 204, contentType: null, body: null },
410
+ { op: "smtpConfig.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/smtp-config$/, status: 200, contentType: "application/json", body: {
411
+ data: {
412
+ created_at: "2026-01-01T00:00:00.000Z",
413
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
414
+ from_email: "ada@example.com",
415
+ from_name: "string",
416
+ host: "string",
417
+ last_verified_at: "2026-01-01T00:00:00.000Z",
418
+ last_verify_error: "string",
419
+ password: "string",
420
+ password_set: true,
421
+ port: 1,
422
+ secure: true,
423
+ status: "pending",
424
+ updated_at: "2026-01-01T00:00:00.000Z",
425
+ username: "string",
426
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
427
+ }
428
+ } },
429
+ { op: "smtpConfig.update", method: "PUT", pattern: /^\/v1\/workspaces\/[^\/]+\/smtp-config$/, status: 200, contentType: "application/json", body: {
430
+ created_at: "2026-01-01T00:00:00.000Z",
431
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
432
+ from_email: "ada@example.com",
433
+ from_name: "string",
434
+ host: "string",
435
+ last_verified_at: "2026-01-01T00:00:00.000Z",
436
+ last_verify_error: "string",
437
+ password: "string",
438
+ password_set: true,
439
+ port: 1,
440
+ secure: true,
441
+ status: "pending",
442
+ updated_at: "2026-01-01T00:00:00.000Z",
443
+ username: "string",
444
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
445
+ } },
446
+ { op: "suppression.create", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/suppression$/, status: 201, contentType: "application/json", body: {
447
+ added_at: "2026-01-01T00:00:00.000Z",
448
+ email: "user@example.com",
449
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
450
+ reason: "string",
451
+ source: "manual",
452
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
453
+ } },
454
+ { op: "suppression.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/suppression$/, status: 200, contentType: "application/json", body: {
455
+ data: [
456
+ {
457
+ added_at: "2026-01-01T00:00:00.000Z",
458
+ email: "user@example.com",
459
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
460
+ reason: "string",
461
+ source: "manual",
462
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
463
+ }
464
+ ],
465
+ pagination: { next_cursor: null, has_more: false }
466
+ } },
467
+ { op: "broadcasts.create", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/broadcasts$/, status: 201, contentType: "application/json", body: {
468
+ canceled_at: "2026-01-01T00:00:00.000Z",
469
+ completed_at: "2026-01-01T00:00:00.000Z",
470
+ counts: {
471
+ bounced: 1,
472
+ canceled: 0,
473
+ clicked: 0,
474
+ complained: 0,
475
+ delivered: 4,
476
+ failed: 0,
477
+ opened: 0,
478
+ pending: 0,
479
+ recipients: 5,
480
+ sent: 5,
481
+ skipped: 0,
482
+ unsubscribed: 0
483
+ },
484
+ created_at: "2026-01-01T00:00:00.000Z",
485
+ failure_reason: "string",
486
+ from: "Acme <news@acme.com>",
487
+ html: "string",
488
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
489
+ name: "October product update",
490
+ rate_per_minute: 1,
491
+ scheduled_at: "2026-01-01T00:00:00.000Z",
492
+ segment_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
493
+ started_at: "2026-01-01T00:00:00.000Z",
494
+ status: "draft",
495
+ subject: "What shipped in October",
496
+ template_name: "october-update",
497
+ text: "string",
498
+ topic_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
499
+ updated_at: "2026-01-01T00:00:00.000Z"
500
+ } },
501
+ { op: "broadcasts.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/broadcasts$/, status: 200, contentType: "application/json", body: {
502
+ data: [
503
+ {
504
+ canceled_at: "2026-01-01T00:00:00.000Z",
505
+ completed_at: "2026-01-01T00:00:00.000Z",
506
+ counts: {
507
+ bounced: 1,
508
+ canceled: 0,
509
+ clicked: 0,
510
+ complained: 0,
511
+ delivered: 4,
512
+ failed: 0,
513
+ opened: 0,
514
+ pending: 0,
515
+ recipients: 5,
516
+ sent: 5,
517
+ skipped: 0,
518
+ unsubscribed: 0
519
+ },
520
+ created_at: "2026-01-01T00:00:00.000Z",
521
+ failure_reason: "string",
522
+ from: "Acme <news@acme.com>",
523
+ html: "string",
524
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
525
+ name: "October product update",
526
+ rate_per_minute: 1,
527
+ scheduled_at: "2026-01-01T00:00:00.000Z",
528
+ segment_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
529
+ started_at: "2026-01-01T00:00:00.000Z",
530
+ status: "draft",
531
+ subject: "What shipped in October",
532
+ template_name: "october-update",
533
+ text: "string",
534
+ topic_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
535
+ updated_at: "2026-01-01T00:00:00.000Z"
536
+ }
537
+ ],
538
+ pagination: { next_cursor: null, has_more: false }
539
+ } },
540
+ { op: "mailboxes.create", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/mailboxes$/, status: 201, contentType: "application/json", body: {
541
+ created_at: "2026-01-01T00:00:00.000Z",
542
+ display_name: "string",
543
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
544
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
545
+ local_part: "string",
546
+ owner_account_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
547
+ retention_days: 14,
548
+ seq_id: "7",
549
+ status: "active",
550
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
551
+ } },
552
+ { op: "mailboxes.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/mailboxes$/, status: 200, contentType: "application/json", body: {
553
+ data: [
554
+ {
555
+ created_at: "2026-01-01T00:00:00.000Z",
556
+ display_name: "string",
557
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
558
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
559
+ local_part: "string",
560
+ owner_account_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
561
+ retention_days: 14,
562
+ seq_id: "7",
563
+ status: "active",
564
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
565
+ }
566
+ ],
567
+ pagination: { next_cursor: null, has_more: false }
568
+ } },
569
+ { op: "templates.create", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/templates$/, status: 201, contentType: "application/json", body: {
570
+ body_html: "string",
571
+ body_text: "string",
572
+ created_at: "2026-01-01T00:00:00.000Z",
573
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
574
+ kind: "template",
575
+ name: "string",
576
+ source: "manual",
577
+ source_ref: "string",
578
+ source_synced_at: "2026-01-01T00:00:00.000Z",
579
+ subject: "string",
580
+ tags: ["string"],
581
+ updated_at: "2026-01-01T00:00:00.000Z",
582
+ variables_schema: {},
583
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
584
+ } },
585
+ { op: "templates.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/templates$/, status: 200, contentType: "application/json", body: {
586
+ data: [
587
+ {
588
+ body_html: "string",
589
+ body_text: "string",
590
+ created_at: "2026-01-01T00:00:00.000Z",
591
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
592
+ kind: "template",
593
+ name: "string",
594
+ source: "manual",
595
+ source_ref: "string",
596
+ source_synced_at: "2026-01-01T00:00:00.000Z",
597
+ subject: "string",
598
+ tags: ["string"],
599
+ updated_at: "2026-01-01T00:00:00.000Z",
600
+ variables_schema: {},
601
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
602
+ }
603
+ ],
604
+ pagination: { next_cursor: null, has_more: false }
605
+ } },
606
+ { op: "contacts.create", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/contacts$/, status: 201, contentType: "application/json", body: {
607
+ consent_source: "signup-form-2026",
608
+ consented_at: "2026-01-01T00:00:00.000Z",
609
+ created_at: "2026-01-01T00:00:00.000Z",
610
+ created_via: "api",
611
+ email: "ada@example.com",
612
+ first_name: "string",
613
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
614
+ last_name: "string",
615
+ properties: { company: "Acme" },
616
+ unsubscribed: true,
617
+ unsubscribed_at: "2026-01-01T00:00:00.000Z",
618
+ updated_at: "2026-01-01T00:00:00.000Z"
619
+ } },
620
+ { op: "contacts.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/contacts$/, status: 200, contentType: "application/json", body: {
621
+ data: [
622
+ {
623
+ consent_source: "signup-form-2026",
624
+ consented_at: "2026-01-01T00:00:00.000Z",
625
+ created_at: "2026-01-01T00:00:00.000Z",
626
+ created_via: "api",
627
+ email: "ada@example.com",
628
+ first_name: "string",
629
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
630
+ last_name: "string",
631
+ properties: { company: "Acme" },
632
+ unsubscribed: true,
633
+ unsubscribed_at: "2026-01-01T00:00:00.000Z",
634
+ updated_at: "2026-01-01T00:00:00.000Z"
635
+ }
636
+ ],
637
+ pagination: { next_cursor: null, has_more: false }
638
+ } },
639
+ { op: "messages.erase", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/messages$/, status: 200, contentType: "application/json", body: { deleted: 1 } },
640
+ { op: "messages.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/messages$/, status: 200, contentType: "application/json", body: {
641
+ data: [
642
+ {
643
+ api_key_id: "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
644
+ bcc: ["string"],
645
+ bounce_code: "string",
646
+ bounce_detail: "string",
647
+ bounce_subtype: "General",
648
+ bounce_type: "Permanent",
649
+ cc: ["string"],
650
+ created_at: "2026-01-01T00:00:00.000Z",
651
+ deferral_count: 0,
652
+ deferred_at: "2026-01-01T00:00:00.000Z",
653
+ delivered_at: "2026-01-01T00:00:00.000Z",
654
+ dkim_result: "string",
655
+ dmarc_result: "string",
656
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
657
+ email_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
658
+ from_address: "string",
659
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
660
+ reply_to: ["string"],
661
+ sent_at: "2026-01-01T00:00:00.000Z",
662
+ smtp_transcript: "string",
663
+ source: "api_key",
664
+ spf_result: "string",
665
+ status: "queued",
666
+ subject: "string",
667
+ tags: [{ name: "category", value: "confirm_email" }],
668
+ template_name: "string",
669
+ to_address: "string",
670
+ transport: "ses",
671
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
672
+ }
673
+ ],
674
+ pagination: { next_cursor: null, has_more: false }
675
+ } },
676
+ { op: "received.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/received$/, status: 200, contentType: "application/json", body: {
677
+ data: [
678
+ {
679
+ attachment_count: 1,
680
+ cc: [],
681
+ dkim_result: "pass",
682
+ dmarc_result: "pass",
683
+ from: "jane@example.org",
684
+ id: "7d9c1e2a-3b4c-4d5e-8f6a-7b8c9d0e1f2a",
685
+ mailbox_address: "support@in.example.com",
686
+ mailbox_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
687
+ read_at: "2026-01-01T00:00:00.000Z",
688
+ received_at: "2026-01-01T00:00:00.000Z",
689
+ rfc822_message_id: "<CAF1234@mail.gmail.com>",
690
+ size_bytes: 5120,
691
+ spam: false,
692
+ spam_verdict: "ham",
693
+ spf_result: "pass",
694
+ subject: "Invoice #42",
695
+ to: ["support@in.example.com"]
696
+ }
697
+ ],
698
+ pagination: { next_cursor: null, has_more: false }
699
+ } },
700
+ { op: "segments.create", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/segments$/, status: 201, contentType: "application/json", body: {
701
+ created_at: "2026-01-01T00:00:00.000Z",
702
+ description: "string",
703
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
704
+ name: "Pro customers",
705
+ rule: { conditions: [{ field: "plan", operator: "equals", value: "pro" }], match: "all" },
706
+ type: "static",
707
+ updated_at: "2026-01-01T00:00:00.000Z"
708
+ } },
709
+ { op: "segments.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/segments$/, status: 200, contentType: "application/json", body: {
710
+ data: [
711
+ {
712
+ created_at: "2026-01-01T00:00:00.000Z",
713
+ description: "string",
714
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
715
+ name: "Pro customers",
716
+ rule: { conditions: [{ field: "plan", operator: null, value: "pro" }], match: "all" },
717
+ type: "static",
718
+ updated_at: "2026-01-01T00:00:00.000Z"
719
+ }
720
+ ],
721
+ pagination: { next_cursor: null, has_more: false }
722
+ } },
723
+ { op: "domains.create", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/domains$/, status: 201, contentType: "application/json", body: {
724
+ capabilities: { receiving: "disabled", sending: "enabled" },
725
+ click_tracking: false,
726
+ created_at: "2026-01-01T00:00:00.000Z",
727
+ dkim_public_key: "string",
728
+ dkim_selector: "string",
729
+ dmarc_grade: {
730
+ adkim: "r",
731
+ aspf: "r",
732
+ domain_policy: "none",
733
+ host: "_dmarc.example.com",
734
+ location: "subdomain",
735
+ pct: 100,
736
+ policy: "none",
737
+ record: "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com",
738
+ rua: ["mailto:dmarc@example.com"],
739
+ subdomain_policy: "none",
740
+ warning: "string"
741
+ },
742
+ dmarc_managed: true,
743
+ dns_check_results: {},
744
+ dns_instructions: [
745
+ {
746
+ host: "productcraft._domainkey.mail.example.com",
747
+ priority: 1,
748
+ purpose: "dkim",
749
+ required: true,
750
+ ttl: 1,
751
+ type: "TXT",
752
+ value: "string"
753
+ }
754
+ ],
755
+ dns_provider: { id: "digitalocean", name: "DigitalOcean", source: "detected" },
756
+ dns_provider_detected: "cloudflare",
757
+ dns_provider_id: "cloudflare",
758
+ dns_zone: "example.com",
759
+ fqdn: "productcraft.co",
760
+ health: "ok",
761
+ health_changed_at: "2026-01-01T00:00:00.000Z",
762
+ health_grace_ends_at: "2026-01-01T00:00:00.000Z",
763
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
764
+ intent: "receive",
765
+ last_dns_check_at: "2026-01-01T00:00:00.000Z",
766
+ mail_from_status: "PENDING",
767
+ mail_from_subdomain: "bounce",
768
+ name: "productcraft.co",
769
+ open_tracking: false,
770
+ owner_account_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
771
+ recommended_pending: 2,
772
+ records: [
773
+ {
774
+ name: "productcraft._domainkey.mail",
775
+ priority: 10,
776
+ purpose: "dkim",
777
+ record: "DKIM",
778
+ required: true,
779
+ status: "verified",
780
+ ttl: 3600,
781
+ type: "TXT",
782
+ value: "string"
783
+ }
784
+ ],
785
+ region: "eu-north-1",
786
+ region_name: "Stockholm",
787
+ seq_id: "3",
788
+ ses_dkim_status: "PENDING",
789
+ setup_method: null,
790
+ status: "pending",
791
+ test_address: "test-abc123@productcraft.co",
792
+ test_received_at: "2026-01-01T00:00:00.000Z",
793
+ test_token: "string",
794
+ tls: "opportunistic",
795
+ tracking_subdomain: null,
796
+ verification_status: "pending",
797
+ verification_token: "string",
798
+ verified_at: "2026-01-01T00:00:00.000Z",
799
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
800
+ } },
801
+ { op: "domains.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/domains$/, status: 200, contentType: "application/json", body: {
802
+ data: [
803
+ {
804
+ capabilities: { receiving: "disabled", sending: "enabled" },
805
+ click_tracking: false,
806
+ created_at: "2026-01-01T00:00:00.000Z",
807
+ dkim_public_key: "string",
808
+ dkim_selector: "string",
809
+ dmarc_grade: {
810
+ adkim: "r",
811
+ aspf: "r",
812
+ domain_policy: "none",
813
+ host: "_dmarc.example.com",
814
+ location: "subdomain",
815
+ pct: 100,
816
+ policy: "none",
817
+ record: "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com",
818
+ rua: ["mailto:dmarc@example.com"],
819
+ subdomain_policy: "none",
820
+ warning: "string"
821
+ },
822
+ dmarc_managed: true,
823
+ dns_check_results: {},
824
+ dns_instructions: [
825
+ {
826
+ host: "productcraft._domainkey.mail.example.com",
827
+ priority: 1,
828
+ purpose: "dkim",
829
+ required: true,
830
+ ttl: 1,
831
+ type: "TXT",
832
+ value: "string"
833
+ }
834
+ ],
835
+ dns_provider: { id: "digitalocean", name: "DigitalOcean", source: "detected" },
836
+ dns_provider_detected: "cloudflare",
837
+ dns_provider_id: "cloudflare",
838
+ dns_zone: "example.com",
839
+ fqdn: "productcraft.co",
840
+ health: "ok",
841
+ health_changed_at: "2026-01-01T00:00:00.000Z",
842
+ health_grace_ends_at: "2026-01-01T00:00:00.000Z",
843
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
844
+ intent: "receive",
845
+ last_dns_check_at: "2026-01-01T00:00:00.000Z",
846
+ mail_from_status: "PENDING",
847
+ mail_from_subdomain: "bounce",
848
+ name: "productcraft.co",
849
+ open_tracking: false,
850
+ owner_account_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
851
+ recommended_pending: 2,
852
+ records: [
853
+ {
854
+ name: "productcraft._domainkey.mail",
855
+ priority: 10,
856
+ purpose: "dkim",
857
+ record: "DKIM",
858
+ required: true,
859
+ status: "verified",
860
+ ttl: 3600,
861
+ type: "TXT",
862
+ value: "string"
863
+ }
864
+ ],
865
+ region: "eu-north-1",
866
+ region_name: "Stockholm",
867
+ seq_id: "3",
868
+ ses_dkim_status: "PENDING",
869
+ setup_method: null,
870
+ status: "pending",
871
+ test_address: "test-abc123@productcraft.co",
872
+ test_received_at: "2026-01-01T00:00:00.000Z",
873
+ test_token: "string",
874
+ tls: "opportunistic",
875
+ tracking_subdomain: null,
876
+ verification_status: "pending",
877
+ verification_token: "string",
878
+ verified_at: "2026-01-01T00:00:00.000Z",
879
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
880
+ }
881
+ ],
882
+ pagination: { next_cursor: null, has_more: false }
883
+ } },
884
+ { op: "emails.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/emails$/, status: 200, contentType: "application/json", body: {
885
+ data: [
886
+ {
887
+ bcc: ["string"],
888
+ cc: ["string"],
889
+ created_at: "2026-01-01T00:00:00.000Z",
890
+ from: "ada@example.com",
891
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
892
+ last_event: "queued",
893
+ recipient_count: 1,
894
+ reply_to: ["string"],
895
+ subject: "string",
896
+ tags: [{ name: "category", value: "confirm_email" }],
897
+ template_name: "string",
898
+ to: ["string"]
899
+ }
900
+ ],
901
+ pagination: { next_cursor: null, has_more: false }
902
+ } },
903
+ { op: "emails.send", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/emails$/, status: 202, contentType: "application/json", body: { id: "4f8b2c1e-9a3d-4e57-b6f0-2d1c8e7a9b05" } },
904
+ { op: "topics.create", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/topics$/, status: 201, contentType: "application/json", body: {
905
+ created_at: "2026-01-01T00:00:00.000Z",
906
+ default_subscription: "opt_in",
907
+ description: "string",
908
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
909
+ name: "Product updates",
910
+ updated_at: "2026-01-01T00:00:00.000Z",
911
+ visibility: "public"
912
+ } },
913
+ { op: "topics.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/topics$/, status: 200, contentType: "application/json", body: {
914
+ data: [
915
+ {
916
+ created_at: "2026-01-01T00:00:00.000Z",
917
+ default_subscription: "opt_in",
918
+ description: "string",
919
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
920
+ name: "Product updates",
921
+ updated_at: "2026-01-01T00:00:00.000Z",
922
+ visibility: "public"
923
+ }
924
+ ],
925
+ pagination: { next_cursor: null, has_more: false }
926
+ } },
927
+ { op: "brand.reset", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/brand$/, status: 204, contentType: null, body: null },
928
+ { op: "brand.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/brand$/, status: 200, contentType: "application/json", body: {
929
+ raw: {
930
+ background_color: "string",
931
+ brand_name: "string",
932
+ button_radius: "string",
933
+ card_background_color: "string",
934
+ container_max_width: "string",
935
+ extras: {},
936
+ font_stack: "string",
937
+ footer_address: "string",
938
+ footer_html: "string",
939
+ logo_url: "https://example.com",
940
+ muted_text_color: "string",
941
+ primary_color: "string",
942
+ secondary_color: "string",
943
+ social_links: {},
944
+ text_color: "string",
945
+ updated_at: "2026-01-01T00:00:00.000Z"
946
+ },
947
+ resolved: {
948
+ background_color: "#f4f4f7",
949
+ brand_name: "string",
950
+ button_radius: "6px",
951
+ card_background_color: "#ffffff",
952
+ container_max_width: "560px",
953
+ extras: {},
954
+ font_stack: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica Neue, Arial, sans-serif',
955
+ footer_address: "string",
956
+ footer_html: "string",
957
+ logo_url: "https://example.com",
958
+ muted_text_color: "#6b7280",
959
+ primary_color: "#2d29d7",
960
+ secondary_color: "#4338ca",
961
+ social_links: {},
962
+ text_color: "#0a0a0e"
963
+ }
964
+ } },
965
+ { op: "brand.update", method: "PUT", pattern: /^\/v1\/workspaces\/[^\/]+\/brand$/, status: 200, contentType: "application/json", body: {
966
+ raw: {
967
+ background_color: "string",
968
+ brand_name: "string",
969
+ button_radius: "string",
970
+ card_background_color: "string",
971
+ container_max_width: "string",
972
+ extras: {},
973
+ font_stack: "string",
974
+ footer_address: "string",
975
+ footer_html: "string",
976
+ logo_url: "https://example.com",
977
+ muted_text_color: "string",
978
+ primary_color: "string",
979
+ secondary_color: "string",
980
+ social_links: {},
981
+ text_color: "string",
982
+ updated_at: "2026-01-01T00:00:00.000Z"
983
+ },
984
+ resolved: {
985
+ background_color: "#f4f4f7",
986
+ brand_name: "string",
987
+ button_radius: "6px",
988
+ card_background_color: "#ffffff",
989
+ container_max_width: "560px",
990
+ extras: {},
991
+ font_stack: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica Neue, Arial, sans-serif',
992
+ footer_address: "string",
993
+ footer_html: "string",
994
+ logo_url: "https://example.com",
995
+ muted_text_color: "#6b7280",
996
+ primary_color: "#2d29d7",
997
+ secondary_color: "#4338ca",
998
+ social_links: {},
999
+ text_color: "#0a0a0e"
1000
+ }
1001
+ } },
1002
+ { op: "stats.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/stats$/, status: 200, contentType: "application/json", body: {
1003
+ generated_at: "2026-10-07T09:00:00.000Z",
1004
+ in_window: {
1005
+ bounce_rate: 0.0185,
1006
+ bounced: 12,
1007
+ complained: 1,
1008
+ complaint_rate: 1e-4,
1009
+ deferred: 3,
1010
+ delivered: 1100,
1011
+ delivery_rate: 0.974,
1012
+ emails: 1173,
1013
+ failed: 0,
1014
+ sent: 1180,
1015
+ suppressed: 5,
1016
+ tracked: 1150,
1017
+ unconfirmed: 60
1018
+ },
1019
+ last_activity_at: "2026-10-07T08:41:12.000Z",
1020
+ series: { granularity: "day", metric: "sent", points: [{ date: "2026-10-07", value: 42 }] },
1021
+ totals: { attention_domains: 1, domains: 3, verified_domains: 2 },
1022
+ window: "30d"
1023
+ } },
1024
+ { op: "domains.smtpConfig.verifySaved", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/domains\/[^\/]+\/smtp-config\/verify-saved$/, status: 200, contentType: "application/json", body: {
1025
+ error: { code: "EAUTH", message: "Authentication failed \u2014 check the username and password." },
1026
+ ok: true
1027
+ } },
1028
+ { op: "webhooks.endpoints.rotateSecret", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/webhooks\/endpoints\/[^\/]+\/rotate-secret$/, status: 200, contentType: "application/json", body: {
1029
+ consecutive_failures: 1,
1030
+ created_at: "2026-01-01T00:00:00.000Z",
1031
+ description: "Production receiver",
1032
+ disabled_at: "2026-01-01T00:00:00.000Z",
1033
+ disabled_reason: "manual",
1034
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1035
+ enabled: true,
1036
+ event_types: [],
1037
+ events: ["email.delivered"],
1038
+ first_failure_at: "2026-01-01T00:00:00.000Z",
1039
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1040
+ legacy_signature: true,
1041
+ legacy_slot: "default",
1042
+ prev_signing_secret_active: true,
1043
+ prev_signing_secret_expires_at: "2026-01-01T00:00:00.000Z",
1044
+ scope_id: "string",
1045
+ scope_type: "workspace",
1046
+ signing_secret: "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw",
1047
+ signing_secret_hint: "x9Q=",
1048
+ status: "enabled",
1049
+ updated_at: "2026-01-01T00:00:00.000Z",
1050
+ url: "https://api.acme.com/webhooks"
1051
+ } },
1052
+ { op: "domains.domainConnect.start", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/domains\/[^\/]+\/domain-connect\/start$/, status: 200, contentType: "application/json", body: {
1053
+ expires_at: "2026-01-01T00:00:00.000Z",
1054
+ includes_dmarc: true,
1055
+ provider_name: "Cloudflare",
1056
+ url: "https://dash.cloudflare.com/domainconnect/v2/domainTemplates/providers/productcraft.co/services/mail/apply?domain=example.com&host=mail&dkimkey=MIIBIjANBg...&redirect_uri=https%3A%2F%2Fapi.mail.productcraft.co%2Fv1%2Fdomain-connect%2Fcallback&state=3q2-7wVdZ6xYb9mJk1Lr0pQs4tUv8wXy&key=_dck1&sig=Qm9n...",
1057
+ zone: "example.com"
1058
+ } },
1059
+ { op: "domains.dnsRecords.export", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/domains\/[^\/]+\/dns-records\/export$/, status: 200, contentType: "text/csv", body: "type,name,value,priority,ttl,purpose,required\r\nTXT,productcraft._domainkey.mail.example.com,v=DKIM1; k=rsa; p=MIIB...,,3600,dkim,true\r\n" },
1060
+ { op: "domains.dnsRecords.apply", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/domains\/[^\/]+\/dns-records\/apply$/, status: 200, contentType: "application/json", body: {
1061
+ applied: false,
1062
+ conflicts: [
1063
+ {
1064
+ code: "spf_multiple",
1065
+ host: "bounce.mail.example.com",
1066
+ message: "string",
1067
+ purpose: "mail_from_mx",
1068
+ severity: "blocking",
1069
+ suggested_value: "v=spf1 include:amazonses.com include:_spf.google.com ~all"
1070
+ }
1071
+ ],
1072
+ counts: { create: 4, failed: 0, skip: 0, update: 0 },
1073
+ dmarc_available: true,
1074
+ dns_records: {
1075
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1076
+ fqdn: "mail.example.com",
1077
+ health: "ok",
1078
+ health_changed_at: "2026-01-01T00:00:00.000Z",
1079
+ health_grace_ends_at: "2026-01-01T00:00:00.000Z",
1080
+ last_checked_at: "2026-01-01T00:00:00.000Z",
1081
+ records: [
1082
+ {
1083
+ conflicts: [
1084
+ {
1085
+ code: "spf_multiple",
1086
+ message: "string",
1087
+ severity: null,
1088
+ suggested_value: "v=spf1 include:amazonses.com include:_spf.google.com ~all"
1089
+ }
1090
+ ],
1091
+ covered_by: "_dmarc.example.com",
1092
+ first_verified_at: "2026-01-01T00:00:00.000Z",
1093
+ found: ["string"],
1094
+ hint: "Your nameservers already serve it; public resolvers will within ~30 min (the zone's negative-cache TTL is 1800 s).",
1095
+ host: "productcraft._domainkey.mail.example.com",
1096
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1097
+ last_changed_at: "2026-01-01T00:00:00.000Z",
1098
+ last_checked_at: "2026-01-01T00:00:00.000Z",
1099
+ name_relative: "productcraft._domainkey.mail",
1100
+ priority: 10,
1101
+ purpose: "dkim",
1102
+ required: true,
1103
+ state: "verified",
1104
+ ttl: 3600,
1105
+ type: "TXT",
1106
+ value: "v=DKIM1; k=rsa; p=MIIBIjANBgkqh\u2026"
1107
+ }
1108
+ ],
1109
+ ses: { dkim_status: "PENDING", enabled: true, mail_from_status: "PENDING" },
1110
+ status: "pending",
1111
+ zone: "example.com"
1112
+ },
1113
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1114
+ dry_run: true,
1115
+ fqdn: "mail.example.com",
1116
+ plan: [
1117
+ {
1118
+ action: "create",
1119
+ after: "v=DKIM1; k=rsa; p=MIIBIjANBgkqh\u2026",
1120
+ before: null,
1121
+ conflicts: [
1122
+ {
1123
+ code: "spf_multiple",
1124
+ message: "string",
1125
+ severity: "blocking",
1126
+ suggested_value: "v=spf1 include:amazonses.com include:_spf.google.com ~all"
1127
+ }
1128
+ ],
1129
+ error: null,
1130
+ existing: ["string"],
1131
+ host: "productcraft._domainkey.mail.example.com",
1132
+ name_relative: "productcraft._domainkey.mail",
1133
+ note: null,
1134
+ optional: false,
1135
+ priority: null,
1136
+ purpose: "dkim",
1137
+ required: true,
1138
+ result: "created",
1139
+ ttl: 3600,
1140
+ type: "TXT",
1141
+ value: "v=DKIM1; k=rsa; p=MIIBIjANBgkqh\u2026"
1142
+ }
1143
+ ],
1144
+ provider: "cloudflare",
1145
+ warnings: ["token_scope_broader_than_zone"],
1146
+ zone: "example.com"
1147
+ } },
1148
+ { op: "domains.dnsRecords.check", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/domains\/[^\/]+\/dns-records\/check$/, status: 200, contentType: "application/json", body: {
1149
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1150
+ fqdn: "mail.example.com",
1151
+ health: "ok",
1152
+ health_changed_at: "2026-01-01T00:00:00.000Z",
1153
+ health_grace_ends_at: "2026-01-01T00:00:00.000Z",
1154
+ last_checked_at: "2026-01-01T00:00:00.000Z",
1155
+ records: [
1156
+ {
1157
+ conflicts: [
1158
+ {
1159
+ code: "spf_multiple",
1160
+ message: "string",
1161
+ severity: "blocking",
1162
+ suggested_value: "v=spf1 include:amazonses.com include:_spf.google.com ~all"
1163
+ }
1164
+ ],
1165
+ covered_by: "_dmarc.example.com",
1166
+ first_verified_at: "2026-01-01T00:00:00.000Z",
1167
+ found: ["string"],
1168
+ hint: "Your nameservers already serve it; public resolvers will within ~30 min (the zone's negative-cache TTL is 1800 s).",
1169
+ host: "productcraft._domainkey.mail.example.com",
1170
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1171
+ last_changed_at: "2026-01-01T00:00:00.000Z",
1172
+ last_checked_at: "2026-01-01T00:00:00.000Z",
1173
+ name_relative: "productcraft._domainkey.mail",
1174
+ priority: 10,
1175
+ purpose: "dkim",
1176
+ required: true,
1177
+ state: "verified",
1178
+ ttl: 3600,
1179
+ type: "TXT",
1180
+ value: "v=DKIM1; k=rsa; p=MIIBIjANBgkqh\u2026"
1181
+ }
1182
+ ],
1183
+ ses: { dkim_status: "PENDING", enabled: true, mail_from_status: "PENDING" },
1184
+ status: "pending",
1185
+ zone: "example.com"
1186
+ } },
1187
+ { op: "broadcasts.clickedLinks.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/broadcasts\/[^\/]+\/clicked-links$/, status: 200, contentType: "application/json", body: { data: [{ clicks: 12, unique_recipients: 9, url: "https://acme.com/blog/october" }] } },
1188
+ { op: "integrations.github.sync.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/integrations\/github\/sync\/[^\/]+$/, status: 200, contentType: "application/json", body: {
1189
+ ended_at: "2026-01-01T00:00:00.000Z",
1190
+ error: "string",
1191
+ started_at: "2026-01-01T00:00:00.000Z",
1192
+ status: "running",
1193
+ summary: {}
1194
+ } },
1195
+ { op: "webhooks.endpoints.test", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/webhooks\/endpoints\/[^\/]+\/test$/, status: 200, contentType: "application/json", body: {
1196
+ attempt_number: 1,
1197
+ attempted_at: "2026-01-01T00:00:00.000Z",
1198
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1199
+ endpoint_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1200
+ error_message: "request timed out",
1201
+ event_id: "evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f",
1202
+ event_type: "user.created",
1203
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1204
+ latency_ms: 1,
1205
+ response_body: "string",
1206
+ response_body_truncated: "string",
1207
+ status_code: 1,
1208
+ succeeded: true,
1209
+ trigger: "automatic",
1210
+ url: "https://example.com"
1211
+ } },
1212
+ { op: "webhooks.events.replay", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/webhooks\/events\/[^\/]+\/replay$/, status: 200, contentType: "application/json", body: {
1213
+ attempts: [
1214
+ {
1215
+ attempt_number: 1,
1216
+ attempted_at: "2026-01-01T00:00:00.000Z",
1217
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1218
+ endpoint_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1219
+ error_message: "request timed out",
1220
+ event_id: "evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f",
1221
+ event_type: "user.created",
1222
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1223
+ latency_ms: 1,
1224
+ response_body: "string",
1225
+ response_body_truncated: "string",
1226
+ status_code: 1,
1227
+ succeeded: true,
1228
+ trigger: "automatic",
1229
+ url: "https://example.com"
1230
+ }
1231
+ ],
1232
+ event_id: "string"
1233
+ } },
1234
+ { op: "broadcasts.recipients.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/broadcasts\/[^\/]+\/recipients$/, status: 200, contentType: "application/json", body: {
1235
+ data: [
1236
+ {
1237
+ contact_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1238
+ email: "ada@example.com",
1239
+ error: "string",
1240
+ error_code: "RECIPIENT_SUPPRESSED",
1241
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1242
+ message_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1243
+ message_status: "delivered",
1244
+ sent_at: "2026-01-01T00:00:00.000Z",
1245
+ status: "pending"
1246
+ }
1247
+ ],
1248
+ pagination: { next_cursor: null, has_more: false }
1249
+ } },
1250
+ { op: "broadcasts.duplicate", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/broadcasts\/[^\/]+\/duplicate$/, status: 201, contentType: "application/json", body: {
1251
+ canceled_at: "2026-01-01T00:00:00.000Z",
1252
+ completed_at: "2026-01-01T00:00:00.000Z",
1253
+ counts: {
1254
+ bounced: 1,
1255
+ canceled: 0,
1256
+ clicked: 0,
1257
+ complained: 0,
1258
+ delivered: 4,
1259
+ failed: 0,
1260
+ opened: 0,
1261
+ pending: 0,
1262
+ recipients: 5,
1263
+ sent: 5,
1264
+ skipped: 0,
1265
+ unsubscribed: 0
1266
+ },
1267
+ created_at: "2026-01-01T00:00:00.000Z",
1268
+ failure_reason: "string",
1269
+ from: "Acme <news@acme.com>",
1270
+ html: "string",
1271
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1272
+ name: "October product update",
1273
+ rate_per_minute: 1,
1274
+ scheduled_at: "2026-01-01T00:00:00.000Z",
1275
+ segment_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1276
+ started_at: "2026-01-01T00:00:00.000Z",
1277
+ status: "draft",
1278
+ subject: "What shipped in October",
1279
+ template_name: "october-update",
1280
+ text: "string",
1281
+ topic_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1282
+ updated_at: "2026-01-01T00:00:00.000Z"
1283
+ } },
1284
+ { op: "templates.sendBatch", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/templates\/[^\/]+\/send-batch$/, status: 200, contentType: "application/json", body: {
1285
+ data: [
1286
+ {
1287
+ error: { code: "string", message: "string" },
1288
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1289
+ index: 1,
1290
+ status: "accepted"
1291
+ }
1292
+ ],
1293
+ summary: { accepted: 1, rejected: 1 }
1294
+ } },
1295
+ { op: "domains.dnsRecords.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/domains\/[^\/]+\/dns-records$/, status: 200, contentType: "application/json", body: {
1296
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1297
+ fqdn: "mail.example.com",
1298
+ health: "ok",
1299
+ health_changed_at: "2026-01-01T00:00:00.000Z",
1300
+ health_grace_ends_at: "2026-01-01T00:00:00.000Z",
1301
+ last_checked_at: "2026-01-01T00:00:00.000Z",
1302
+ records: [
1303
+ {
1304
+ conflicts: [
1305
+ {
1306
+ code: "spf_multiple",
1307
+ message: "string",
1308
+ severity: "blocking",
1309
+ suggested_value: "v=spf1 include:amazonses.com include:_spf.google.com ~all"
1310
+ }
1311
+ ],
1312
+ covered_by: "_dmarc.example.com",
1313
+ first_verified_at: "2026-01-01T00:00:00.000Z",
1314
+ found: ["string"],
1315
+ hint: "Your nameservers already serve it; public resolvers will within ~30 min (the zone's negative-cache TTL is 1800 s).",
1316
+ host: "productcraft._domainkey.mail.example.com",
1317
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1318
+ last_changed_at: "2026-01-01T00:00:00.000Z",
1319
+ last_checked_at: "2026-01-01T00:00:00.000Z",
1320
+ name_relative: "productcraft._domainkey.mail",
1321
+ priority: 10,
1322
+ purpose: "dkim",
1323
+ required: true,
1324
+ state: "verified",
1325
+ ttl: 3600,
1326
+ type: "TXT",
1327
+ value: "v=DKIM1; k=rsa; p=MIIBIjANBgkqh\u2026"
1328
+ }
1329
+ ],
1330
+ ses: { dkim_status: "PENDING", enabled: true, mail_from_status: "PENDING" },
1331
+ status: "pending",
1332
+ zone: "example.com"
1333
+ } },
1334
+ { op: "domains.shareLinks.create", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/domains\/[^\/]+\/share-links$/, status: 201, contentType: "application/json", body: {
1335
+ api_url: "https://api.mail.productcraft.co/v1/public/domain-setup/3q2-7wVdZ6xYb9mJk1Lr0pQs4tUv8wXyZaBcDeFgHiJ",
1336
+ created_at: "2026-01-01T00:00:00.000Z",
1337
+ created_by: "string",
1338
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1339
+ emailed_to: ["it@example.com"],
1340
+ emailed_to_count: 1,
1341
+ expires_at: "2026-01-01T00:00:00.000Z",
1342
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1343
+ last_viewed_at: "2026-01-01T00:00:00.000Z",
1344
+ revoked_at: "2026-01-01T00:00:00.000Z",
1345
+ status: "active",
1346
+ url: "https://console.productcraft.co/mail/setup/3q2-7wVdZ6xYb9mJk1Lr0pQs4tUv8wXyZaBcDeFgHiJ"
1347
+ } },
1348
+ { op: "domains.shareLinks.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/domains\/[^\/]+\/share-links$/, status: 200, contentType: "application/json", body: {
1349
+ data: [
1350
+ {
1351
+ created_at: "2026-01-01T00:00:00.000Z",
1352
+ created_by: "string",
1353
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1354
+ emailed_to_count: 1,
1355
+ expires_at: "2026-01-01T00:00:00.000Z",
1356
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1357
+ last_viewed_at: "2026-01-01T00:00:00.000Z",
1358
+ revoked_at: "2026-01-01T00:00:00.000Z",
1359
+ status: "active"
1360
+ }
1361
+ ],
1362
+ pagination: { next_cursor: null, has_more: false }
1363
+ } },
1364
+ { op: "domains.smtpConfig.reset", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/domains\/[^\/]+\/smtp-config$/, status: 204, contentType: null, body: null },
1365
+ { op: "domains.smtpConfig.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/domains\/[^\/]+\/smtp-config$/, status: 200, contentType: "application/json", body: {
1366
+ data: {
1367
+ created_at: "2026-01-01T00:00:00.000Z",
1368
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1369
+ from_email: "ada@example.com",
1370
+ from_name: "string",
1371
+ host: "string",
1372
+ last_verified_at: "2026-01-01T00:00:00.000Z",
1373
+ last_verify_error: "string",
1374
+ password: "string",
1375
+ password_set: true,
1376
+ port: 1,
1377
+ secure: true,
1378
+ status: "pending",
1379
+ updated_at: "2026-01-01T00:00:00.000Z",
1380
+ username: "string",
1381
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
1382
+ }
1383
+ } },
1384
+ { op: "domains.smtpConfig.update", method: "PUT", pattern: /^\/v1\/workspaces\/[^\/]+\/domains\/[^\/]+\/smtp-config$/, status: 200, contentType: "application/json", body: {
1385
+ created_at: "2026-01-01T00:00:00.000Z",
1386
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1387
+ from_email: "ada@example.com",
1388
+ from_name: "string",
1389
+ host: "string",
1390
+ last_verified_at: "2026-01-01T00:00:00.000Z",
1391
+ last_verify_error: "string",
1392
+ password: "string",
1393
+ password_set: true,
1394
+ port: 1,
1395
+ secure: true,
1396
+ status: "pending",
1397
+ updated_at: "2026-01-01T00:00:00.000Z",
1398
+ username: "string",
1399
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
1400
+ } },
1401
+ { op: "templates.testSend", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/templates\/[^\/]+\/test-send$/, status: 202, contentType: "application/json", body: {
1402
+ accepted: true,
1403
+ email_id: "4f8b2c1e-9a3d-4e57-b6f0-2d1c8e7a9b05",
1404
+ from: "Acme <hello@acme.com>",
1405
+ id: "4f8b2c1e-9a3d-4e57-b6f0-2d1c8e7a9b05",
1406
+ subject: "string",
1407
+ to: "user@example.com"
1408
+ } },
1409
+ { op: "templates.variables.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/templates\/[^\/]+\/variables$/, status: 200, contentType: "application/json", body: { data: ["string"] } },
1410
+ { op: "contacts.properties.delete", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/contact-properties\/[^\/]+$/, status: 204, contentType: null, body: null },
1411
+ { op: "contacts.properties.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/contact-properties\/[^\/]+$/, status: 200, contentType: "application/json", body: {
1412
+ created_at: "2026-01-01T00:00:00.000Z",
1413
+ fallback_value: "string",
1414
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1415
+ key: "company",
1416
+ type: "string",
1417
+ updated_at: "2026-01-01T00:00:00.000Z"
1418
+ } },
1419
+ { op: "contacts.properties.update", method: "PATCH", pattern: /^\/v1\/workspaces\/[^\/]+\/contact-properties\/[^\/]+$/, status: 200, contentType: "application/json", body: {
1420
+ created_at: "2026-01-01T00:00:00.000Z",
1421
+ fallback_value: "string",
1422
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1423
+ key: "company",
1424
+ type: "string",
1425
+ updated_at: "2026-01-01T00:00:00.000Z"
1426
+ } },
1427
+ { op: "mailboxes.messages.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/mailboxes\/[^\/]+\/messages$/, status: 200, contentType: "application/json", body: {
1428
+ data: [
1429
+ {
1430
+ body_preview: "string",
1431
+ cc_addresses: ["string"],
1432
+ deleted_at: "2026-01-01T00:00:00.000Z",
1433
+ dkim_result: "string",
1434
+ dmarc_result: "string",
1435
+ envelope_to: "string",
1436
+ from_address: "string",
1437
+ from_domain: "string",
1438
+ from_local: "string",
1439
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1440
+ mailbox_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1441
+ quarantined: true,
1442
+ raw_object_key: "string",
1443
+ read_at: "2026-01-01T00:00:00.000Z",
1444
+ received_at: "2026-01-01T00:00:00.000Z",
1445
+ rfc822_message_id: "string",
1446
+ seq_id: "42",
1447
+ size_bytes: 1,
1448
+ spam_score: "string",
1449
+ spam_verdict: "string",
1450
+ spf_result: "string",
1451
+ subject: "string",
1452
+ to_addresses: ["string"]
1453
+ }
1454
+ ],
1455
+ pagination: { next_cursor: null, has_more: false }
1456
+ } },
1457
+ { op: "webhooks.endpoints.delete", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/webhooks\/endpoints\/[^\/]+$/, status: 204, contentType: null, body: null },
1458
+ { op: "webhooks.endpoints.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/webhooks\/endpoints\/[^\/]+$/, status: 200, contentType: "application/json", body: {
1459
+ consecutive_failures: 1,
1460
+ created_at: "2026-01-01T00:00:00.000Z",
1461
+ description: "Production receiver",
1462
+ disabled_at: "2026-01-01T00:00:00.000Z",
1463
+ disabled_reason: "manual",
1464
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1465
+ enabled: true,
1466
+ event_types: [],
1467
+ events: ["email.delivered"],
1468
+ first_failure_at: "2026-01-01T00:00:00.000Z",
1469
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1470
+ legacy_signature: true,
1471
+ legacy_slot: "default",
1472
+ prev_signing_secret_active: true,
1473
+ prev_signing_secret_expires_at: "2026-01-01T00:00:00.000Z",
1474
+ scope_id: "string",
1475
+ scope_type: "workspace",
1476
+ signing_secret_hint: "x9Q=",
1477
+ status: "enabled",
1478
+ updated_at: "2026-01-01T00:00:00.000Z",
1479
+ url: "https://api.acme.com/webhooks"
1480
+ } },
1481
+ { op: "webhooks.endpoints.update", method: "PATCH", pattern: /^\/v1\/workspaces\/[^\/]+\/webhooks\/endpoints\/[^\/]+$/, status: 200, contentType: "application/json", body: {
1482
+ consecutive_failures: 1,
1483
+ created_at: "2026-01-01T00:00:00.000Z",
1484
+ description: "Production receiver",
1485
+ disabled_at: "2026-01-01T00:00:00.000Z",
1486
+ disabled_reason: "manual",
1487
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1488
+ enabled: true,
1489
+ event_types: [],
1490
+ events: ["email.delivered"],
1491
+ first_failure_at: "2026-01-01T00:00:00.000Z",
1492
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1493
+ legacy_signature: true,
1494
+ legacy_slot: "default",
1495
+ prev_signing_secret_active: true,
1496
+ prev_signing_secret_expires_at: "2026-01-01T00:00:00.000Z",
1497
+ scope_id: "string",
1498
+ scope_type: "workspace",
1499
+ signing_secret_hint: "x9Q=",
1500
+ status: "enabled",
1501
+ updated_at: "2026-01-01T00:00:00.000Z",
1502
+ url: "https://api.acme.com/webhooks"
1503
+ } },
1504
+ { op: "broadcasts.cancel", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/broadcasts\/[^\/]+\/cancel$/, status: 200, contentType: "application/json", body: {
1505
+ canceled_at: "2026-01-01T00:00:00.000Z",
1506
+ completed_at: "2026-01-01T00:00:00.000Z",
1507
+ counts: {
1508
+ bounced: 1,
1509
+ canceled: 0,
1510
+ clicked: 0,
1511
+ complained: 0,
1512
+ delivered: 4,
1513
+ failed: 0,
1514
+ opened: 0,
1515
+ pending: 0,
1516
+ recipients: 5,
1517
+ sent: 5,
1518
+ skipped: 0,
1519
+ unsubscribed: 0
1520
+ },
1521
+ created_at: "2026-01-01T00:00:00.000Z",
1522
+ failure_reason: "string",
1523
+ from: "Acme <news@acme.com>",
1524
+ html: "string",
1525
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1526
+ name: "October product update",
1527
+ rate_per_minute: 1,
1528
+ scheduled_at: "2026-01-01T00:00:00.000Z",
1529
+ segment_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1530
+ started_at: "2026-01-01T00:00:00.000Z",
1531
+ status: "draft",
1532
+ subject: "What shipped in October",
1533
+ template_name: "october-update",
1534
+ text: "string",
1535
+ topic_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1536
+ updated_at: "2026-01-01T00:00:00.000Z"
1537
+ } },
1538
+ { op: "contacts.segments.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/contacts\/[^\/]+\/segments$/, status: 200, contentType: "application/json", body: {
1539
+ contact_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1540
+ data: [
1541
+ {
1542
+ created_at: "2026-01-01T00:00:00.000Z",
1543
+ description: "string",
1544
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1545
+ name: "Pro customers",
1546
+ rule: { conditions: [{ field: "plan", operator: null, value: "pro" }], match: "all" },
1547
+ type: "static",
1548
+ updated_at: "2026-01-01T00:00:00.000Z"
1549
+ }
1550
+ ]
1551
+ } },
1552
+ { op: "domains.testSend", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/domains\/[^\/]+\/test-send$/, status: 202, contentType: "application/json", body: {
1553
+ accepted: true,
1554
+ email_id: "4f8b2c1e-9a3d-4e57-b6f0-2d1c8e7a9b05",
1555
+ from: "Acme <hello@acme.com>",
1556
+ id: "4f8b2c1e-9a3d-4e57-b6f0-2d1c8e7a9b05",
1557
+ subject: "string",
1558
+ to: "user@example.com"
1559
+ } },
1560
+ { op: "segments.contacts.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/segments\/[^\/]+\/contacts$/, status: 200, contentType: "application/json", body: {
1561
+ data: [
1562
+ {
1563
+ consent_source: "signup-form-2026",
1564
+ consented_at: "2026-01-01T00:00:00.000Z",
1565
+ created_at: "2026-01-01T00:00:00.000Z",
1566
+ created_via: "api",
1567
+ email: "ada@example.com",
1568
+ first_name: "string",
1569
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1570
+ last_name: "string",
1571
+ properties: { company: "Acme" },
1572
+ unsubscribed: true,
1573
+ unsubscribed_at: "2026-01-01T00:00:00.000Z",
1574
+ updated_at: "2026-01-01T00:00:00.000Z"
1575
+ }
1576
+ ],
1577
+ pagination: { next_cursor: null, has_more: false }
1578
+ } },
1579
+ { op: "contacts.imports.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/contacts\/imports\/[^\/]+$/, status: 200, contentType: "application/json", body: {
1580
+ completed_at: "2026-01-01T00:00:00.000Z",
1581
+ consent_source: "string",
1582
+ consented_count: 1,
1583
+ created_at: "2026-01-01T00:00:00.000Z",
1584
+ created_count: 1,
1585
+ error_count: 1,
1586
+ errors: [{ error: "invalid or missing email", line: 1 }],
1587
+ failure_reason: "string",
1588
+ filename: "string",
1589
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1590
+ on_conflict: "upsert",
1591
+ processed_rows: 1,
1592
+ size_bytes: 1,
1593
+ skipped_count: 1,
1594
+ started_at: "2026-01-01T00:00:00.000Z",
1595
+ status: "queued",
1596
+ topic_ids: ["9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"],
1597
+ total_rows: 1,
1598
+ updated_count: 1
1599
+ } },
1600
+ { op: "segments.metrics", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/segments\/[^\/]+\/metrics$/, status: 200, contentType: "application/json", body: {
1601
+ computed_at: "2026-01-01T00:00:00.000Z",
1602
+ consented_count: 1100,
1603
+ contact_count: 1240,
1604
+ segment_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1605
+ unsubscribed_count: 31,
1606
+ unsubscribed_share: 0.025
1607
+ } },
1608
+ { op: "templates.render", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/templates\/[^\/]+\/render$/, status: 200, contentType: "application/json", body: { html: "string", subject: "string", text: "string" } },
1609
+ { op: "broadcasts.send", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/broadcasts\/[^\/]+\/send$/, status: 202, contentType: "application/json", body: {
1610
+ canceled_at: "2026-01-01T00:00:00.000Z",
1611
+ completed_at: "2026-01-01T00:00:00.000Z",
1612
+ counts: {
1613
+ bounced: 1,
1614
+ canceled: 0,
1615
+ clicked: 0,
1616
+ complained: 0,
1617
+ delivered: 4,
1618
+ failed: 0,
1619
+ opened: 0,
1620
+ pending: 0,
1621
+ recipients: 5,
1622
+ sent: 5,
1623
+ skipped: 0,
1624
+ unsubscribed: 0
1625
+ },
1626
+ created_at: "2026-01-01T00:00:00.000Z",
1627
+ failure_reason: "string",
1628
+ from: "Acme <news@acme.com>",
1629
+ html: "string",
1630
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1631
+ name: "October product update",
1632
+ rate_per_minute: 1,
1633
+ scheduled_at: "2026-01-01T00:00:00.000Z",
1634
+ segment_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1635
+ started_at: "2026-01-01T00:00:00.000Z",
1636
+ status: "draft",
1637
+ subject: "What shipped in October",
1638
+ template_name: "october-update",
1639
+ text: "string",
1640
+ topic_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1641
+ updated_at: "2026-01-01T00:00:00.000Z"
1642
+ } },
1643
+ { op: "contacts.topics.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/contacts\/[^\/]+\/topics$/, status: 200, contentType: "application/json", body: {
1644
+ contact_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1645
+ data: [
1646
+ {
1647
+ default_subscription: "opt_in",
1648
+ description: "string",
1649
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1650
+ name: "string",
1651
+ reason: "opted_in",
1652
+ subscribed: true,
1653
+ subscription: "opt_in",
1654
+ visibility: "public"
1655
+ }
1656
+ ]
1657
+ } },
1658
+ { op: "contacts.topics.update", method: "PATCH", pattern: /^\/v1\/workspaces\/[^\/]+\/contacts\/[^\/]+\/topics$/, status: 200, contentType: "application/json", body: {
1659
+ contact_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1660
+ data: [
1661
+ {
1662
+ default_subscription: "opt_in",
1663
+ description: "string",
1664
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1665
+ name: "string",
1666
+ reason: "opted_in",
1667
+ subscribed: true,
1668
+ subscription: "opt_in",
1669
+ visibility: "public"
1670
+ }
1671
+ ]
1672
+ } },
1673
+ { op: "webhooks.events.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/webhooks\/events\/[^\/]+$/, status: 200, contentType: "application/json", body: {
1674
+ attempts: [
1675
+ {
1676
+ attempt_number: 1,
1677
+ attempted_at: "2026-01-01T00:00:00.000Z",
1678
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1679
+ endpoint_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1680
+ error_message: "request timed out",
1681
+ event_id: "evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f",
1682
+ event_type: "user.created",
1683
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1684
+ latency_ms: 1,
1685
+ response_body: "string",
1686
+ response_body_truncated: "string",
1687
+ status_code: 1,
1688
+ succeeded: true,
1689
+ trigger: "automatic",
1690
+ url: "https://example.com"
1691
+ }
1692
+ ],
1693
+ created_at: "2026-01-01T00:00:00.000Z",
1694
+ deliveries: [
1695
+ {
1696
+ attempt_number: 1,
1697
+ attempted_at: "2026-01-01T00:00:00.000Z",
1698
+ endpoint_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1699
+ next_attempt_at: "2026-01-01T00:00:00.000Z",
1700
+ status_code: 1,
1701
+ succeeded: true
1702
+ }
1703
+ ],
1704
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1705
+ email_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1706
+ id: "evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f",
1707
+ payload: {},
1708
+ status: "pending",
1709
+ test: true,
1710
+ type: "email.sent"
1711
+ } },
1712
+ { op: "domains.events.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/domains\/[^\/]+\/events$/, status: 200, contentType: "application/json", body: {
1713
+ data: [
1714
+ {
1715
+ detail: { records: [{ purpose: "dkim", state: "missing" }] },
1716
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1717
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1718
+ occurred_at: "2026-01-01T00:00:00.000Z",
1719
+ type: "verified"
1720
+ }
1721
+ ],
1722
+ pagination: { next_cursor: null, has_more: false }
1723
+ } },
1724
+ { op: "domains.verify", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/domains\/[^\/]+\/verify$/, status: 200, contentType: "application/json", body: {
1725
+ capabilities: { receiving: "disabled", sending: "enabled" },
1726
+ click_tracking: false,
1727
+ created_at: "2026-01-01T00:00:00.000Z",
1728
+ dkim_public_key: "string",
1729
+ dkim_selector: "string",
1730
+ dmarc_grade: {
1731
+ adkim: "r",
1732
+ aspf: "r",
1733
+ domain_policy: "none",
1734
+ host: "_dmarc.example.com",
1735
+ location: "subdomain",
1736
+ pct: 100,
1737
+ policy: "none",
1738
+ record: "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com",
1739
+ rua: ["mailto:dmarc@example.com"],
1740
+ subdomain_policy: "none",
1741
+ warning: "string"
1742
+ },
1743
+ dmarc_managed: true,
1744
+ dns_check_results: {},
1745
+ dns_instructions: [
1746
+ {
1747
+ host: "productcraft._domainkey.mail.example.com",
1748
+ priority: 1,
1749
+ purpose: "dkim",
1750
+ required: true,
1751
+ ttl: 1,
1752
+ type: "TXT",
1753
+ value: "string"
1754
+ }
1755
+ ],
1756
+ dns_provider: { id: "digitalocean", name: "DigitalOcean", source: "detected" },
1757
+ dns_provider_detected: "cloudflare",
1758
+ dns_provider_id: "cloudflare",
1759
+ dns_zone: "example.com",
1760
+ fqdn: "productcraft.co",
1761
+ health: "ok",
1762
+ health_changed_at: "2026-01-01T00:00:00.000Z",
1763
+ health_grace_ends_at: "2026-01-01T00:00:00.000Z",
1764
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1765
+ intent: "receive",
1766
+ last_dns_check_at: "2026-01-01T00:00:00.000Z",
1767
+ mail_from_status: "PENDING",
1768
+ mail_from_subdomain: "bounce",
1769
+ name: "productcraft.co",
1770
+ open_tracking: false,
1771
+ owner_account_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1772
+ recommended_pending: 2,
1773
+ records: [
1774
+ {
1775
+ name: "productcraft._domainkey.mail",
1776
+ priority: 10,
1777
+ purpose: "dkim",
1778
+ record: "DKIM",
1779
+ required: true,
1780
+ status: "verified",
1781
+ ttl: 3600,
1782
+ type: "TXT",
1783
+ value: "string"
1784
+ }
1785
+ ],
1786
+ region: "eu-north-1",
1787
+ region_name: "Stockholm",
1788
+ seq_id: "3",
1789
+ ses_dkim_status: "PENDING",
1790
+ setup_method: null,
1791
+ status: "pending",
1792
+ test_address: "test-abc123@productcraft.co",
1793
+ test_received_at: "2026-01-01T00:00:00.000Z",
1794
+ test_token: "string",
1795
+ tls: "opportunistic",
1796
+ tracking_subdomain: null,
1797
+ verification_status: "pending",
1798
+ verification_token: "string",
1799
+ verified_at: "2026-01-01T00:00:00.000Z",
1800
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
1801
+ } },
1802
+ { op: "templates.send", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/templates\/[^\/]+\/send$/, status: 202, contentType: "application/json", body: {
1803
+ accepted: true,
1804
+ email_id: "4f8b2c1e-9a3d-4e57-b6f0-2d1c8e7a9b05",
1805
+ from: "Acme <hello@acme.com>",
1806
+ id: "4f8b2c1e-9a3d-4e57-b6f0-2d1c8e7a9b05",
1807
+ subject: "string",
1808
+ to: "user@example.com"
1809
+ } },
1810
+ { op: "messages.body", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/messages\/[^\/]+\/body$/, status: 200, contentType: "application/json", body: {
1811
+ api_key_id: "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
1812
+ bcc: ["string"],
1813
+ body_html: "string",
1814
+ body_text: "string",
1815
+ bounce_code: "string",
1816
+ bounce_detail: "string",
1817
+ bounce_subtype: "General",
1818
+ bounce_type: "Permanent",
1819
+ cc: ["string"],
1820
+ created_at: "2026-01-01T00:00:00.000Z",
1821
+ deferral_count: 0,
1822
+ deferred_at: "2026-01-01T00:00:00.000Z",
1823
+ delivered_at: "2026-01-01T00:00:00.000Z",
1824
+ dkim_result: "string",
1825
+ dmarc_result: "string",
1826
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1827
+ email_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1828
+ from_address: "string",
1829
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1830
+ reply_to: ["string"],
1831
+ sent_at: "2026-01-01T00:00:00.000Z",
1832
+ smtp_transcript: "string",
1833
+ source: "api_key",
1834
+ spf_result: "string",
1835
+ status: "queued",
1836
+ subject: "string",
1837
+ tags: [{ name: "category", value: "confirm_email" }],
1838
+ template_name: "string",
1839
+ to_address: "string",
1840
+ transport: "ses",
1841
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
1842
+ } },
1843
+ { op: "received.read", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/received\/[^\/]+\/read$/, status: 204, contentType: null, body: null },
1844
+ { op: "integrations.delete", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/integrations\/[^\/]+$/, status: 204, contentType: null, body: null },
1845
+ { op: "integrations.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/integrations\/[^\/]+$/, status: 200, contentType: "application/json", body: {
1846
+ account_avatar_url: "https://avatars.githubusercontent.com/u/1?v=4",
1847
+ account_login: "octocat",
1848
+ credentials_redacted: {},
1849
+ display_name: "GitHub",
1850
+ last_error: "string",
1851
+ last_synced_at: "2026-01-01T00:00:00.000Z",
1852
+ provider: "github",
1853
+ settings: {},
1854
+ status: "active",
1855
+ updated_at: "2026-01-01T00:00:00.000Z"
1856
+ } },
1857
+ { op: "received.raw", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/received\/[^\/]+\/raw$/, status: 200, contentType: "message/rfc822", body: "" },
1858
+ { op: "suppression.delete", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/suppression\/[^\/]+$/, status: 204, contentType: null, body: null },
1859
+ { op: "broadcasts.delete", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/broadcasts\/[^\/]+$/, status: 204, contentType: null, body: null },
1860
+ { op: "broadcasts.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/broadcasts\/[^\/]+$/, status: 200, contentType: "application/json", body: {
1861
+ canceled_at: "2026-01-01T00:00:00.000Z",
1862
+ completed_at: "2026-01-01T00:00:00.000Z",
1863
+ counts: {
1864
+ bounced: 1,
1865
+ canceled: 0,
1866
+ clicked: 0,
1867
+ complained: 0,
1868
+ delivered: 4,
1869
+ failed: 0,
1870
+ opened: 0,
1871
+ pending: 0,
1872
+ recipients: 5,
1873
+ sent: 5,
1874
+ skipped: 0,
1875
+ unsubscribed: 0
1876
+ },
1877
+ created_at: "2026-01-01T00:00:00.000Z",
1878
+ failure_reason: "string",
1879
+ from: "Acme <news@acme.com>",
1880
+ html: "string",
1881
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1882
+ name: "October product update",
1883
+ rate_per_minute: 1,
1884
+ scheduled_at: "2026-01-01T00:00:00.000Z",
1885
+ segment_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1886
+ started_at: "2026-01-01T00:00:00.000Z",
1887
+ status: "draft",
1888
+ subject: "What shipped in October",
1889
+ template_name: "october-update",
1890
+ text: "string",
1891
+ topic_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1892
+ updated_at: "2026-01-01T00:00:00.000Z"
1893
+ } },
1894
+ { op: "broadcasts.update", method: "PATCH", pattern: /^\/v1\/workspaces\/[^\/]+\/broadcasts\/[^\/]+$/, status: 200, contentType: "application/json", body: {
1895
+ canceled_at: "2026-01-01T00:00:00.000Z",
1896
+ completed_at: "2026-01-01T00:00:00.000Z",
1897
+ counts: {
1898
+ bounced: 1,
1899
+ canceled: 0,
1900
+ clicked: 0,
1901
+ complained: 0,
1902
+ delivered: 4,
1903
+ failed: 0,
1904
+ opened: 0,
1905
+ pending: 0,
1906
+ recipients: 5,
1907
+ sent: 5,
1908
+ skipped: 0,
1909
+ unsubscribed: 0
1910
+ },
1911
+ created_at: "2026-01-01T00:00:00.000Z",
1912
+ failure_reason: "string",
1913
+ from: "Acme <news@acme.com>",
1914
+ html: "string",
1915
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1916
+ name: "October product update",
1917
+ rate_per_minute: 1,
1918
+ scheduled_at: "2026-01-01T00:00:00.000Z",
1919
+ segment_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1920
+ started_at: "2026-01-01T00:00:00.000Z",
1921
+ status: "draft",
1922
+ subject: "What shipped in October",
1923
+ template_name: "october-update",
1924
+ text: "string",
1925
+ topic_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1926
+ updated_at: "2026-01-01T00:00:00.000Z"
1927
+ } },
1928
+ { op: "mailboxes.delete", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/mailboxes\/[^\/]+$/, status: 204, contentType: null, body: null },
1929
+ { op: "mailboxes.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/mailboxes\/[^\/]+$/, status: 200, contentType: "application/json", body: {
1930
+ created_at: "2026-01-01T00:00:00.000Z",
1931
+ display_name: "string",
1932
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1933
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1934
+ local_part: "string",
1935
+ owner_account_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1936
+ retention_days: 14,
1937
+ seq_id: "7",
1938
+ status: "active",
1939
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
1940
+ } },
1941
+ { op: "mailboxes.update", method: "PATCH", pattern: /^\/v1\/workspaces\/[^\/]+\/mailboxes\/[^\/]+$/, status: 200, contentType: "application/json", body: {
1942
+ created_at: "2026-01-01T00:00:00.000Z",
1943
+ display_name: "string",
1944
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1945
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1946
+ local_part: "string",
1947
+ owner_account_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1948
+ retention_days: 14,
1949
+ seq_id: "7",
1950
+ status: "active",
1951
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
1952
+ } },
1953
+ { op: "templates.delete", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/templates\/[^\/]+$/, status: 204, contentType: null, body: null },
1954
+ { op: "templates.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/templates\/[^\/]+$/, status: 200, contentType: "application/json", body: {
1955
+ body_html: "string",
1956
+ body_text: "string",
1957
+ created_at: "2026-01-01T00:00:00.000Z",
1958
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1959
+ kind: "template",
1960
+ name: "string",
1961
+ source: "manual",
1962
+ source_ref: "string",
1963
+ source_synced_at: "2026-01-01T00:00:00.000Z",
1964
+ subject: "string",
1965
+ tags: ["string"],
1966
+ updated_at: "2026-01-01T00:00:00.000Z",
1967
+ variables_schema: {},
1968
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
1969
+ } },
1970
+ { op: "contacts.delete", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/contacts\/[^\/]+$/, status: 204, contentType: null, body: null },
1971
+ { op: "contacts.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/contacts\/[^\/]+$/, status: 200, contentType: "application/json", body: {
1972
+ consent_source: "signup-form-2026",
1973
+ consented_at: "2026-01-01T00:00:00.000Z",
1974
+ created_at: "2026-01-01T00:00:00.000Z",
1975
+ created_via: "api",
1976
+ email: "ada@example.com",
1977
+ first_name: "string",
1978
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1979
+ last_name: "string",
1980
+ properties: { company: "Acme" },
1981
+ unsubscribed: true,
1982
+ unsubscribed_at: "2026-01-01T00:00:00.000Z",
1983
+ updated_at: "2026-01-01T00:00:00.000Z"
1984
+ } },
1985
+ { op: "contacts.update", method: "PATCH", pattern: /^\/v1\/workspaces\/[^\/]+\/contacts\/[^\/]+$/, status: 200, contentType: "application/json", body: {
1986
+ consent_source: "signup-form-2026",
1987
+ consented_at: "2026-01-01T00:00:00.000Z",
1988
+ created_at: "2026-01-01T00:00:00.000Z",
1989
+ created_via: "api",
1990
+ email: "ada@example.com",
1991
+ first_name: "string",
1992
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
1993
+ last_name: "string",
1994
+ properties: { company: "Acme" },
1995
+ unsubscribed: true,
1996
+ unsubscribed_at: "2026-01-01T00:00:00.000Z",
1997
+ updated_at: "2026-01-01T00:00:00.000Z"
1998
+ } },
1999
+ { op: "messages.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/messages\/[^\/]+$/, status: 200, contentType: "application/json", body: {
2000
+ api_key_id: "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
2001
+ bcc: ["string"],
2002
+ bounce_code: "string",
2003
+ bounce_detail: "string",
2004
+ bounce_subtype: "General",
2005
+ bounce_type: "Permanent",
2006
+ cc: ["string"],
2007
+ created_at: "2026-01-01T00:00:00.000Z",
2008
+ deferral_count: 0,
2009
+ deferred_at: "2026-01-01T00:00:00.000Z",
2010
+ delivered_at: "2026-01-01T00:00:00.000Z",
2011
+ dkim_result: "string",
2012
+ dmarc_result: "string",
2013
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
2014
+ email_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
2015
+ events: [
2016
+ {
2017
+ detail: { remote_mta: "203.0.113.7", smtp_response: "250 2.0.0 OK", source: "ses" },
2018
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
2019
+ occurred_at: "2026-01-01T00:00:00.000Z",
2020
+ type: "delivered"
2021
+ }
2022
+ ],
2023
+ from_address: "string",
2024
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
2025
+ last_event: {
2026
+ detail: { remote_mta: "203.0.113.7", smtp_response: "250 2.0.0 OK", source: "ses" },
2027
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
2028
+ occurred_at: "2026-01-01T00:00:00.000Z",
2029
+ type: "delivered"
2030
+ },
2031
+ reply_to: ["string"],
2032
+ sent_at: "2026-01-01T00:00:00.000Z",
2033
+ smtp_transcript: "string",
2034
+ source: "api_key",
2035
+ spf_result: "string",
2036
+ status: "queued",
2037
+ subject: "string",
2038
+ tags: [{ name: "category", value: "confirm_email" }],
2039
+ template_name: "string",
2040
+ to_address: "string",
2041
+ transport: "ses",
2042
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
2043
+ } },
2044
+ { op: "received.delete", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/received\/[^\/]+$/, status: 204, contentType: null, body: null },
2045
+ { op: "received.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/received\/[^\/]+$/, status: 200, contentType: "application/json", body: {
2046
+ attachment_count: 1,
2047
+ attachments: [
2048
+ {
2049
+ content_id: "string",
2050
+ content_type: "application/pdf",
2051
+ filename: "invoice.pdf",
2052
+ position: 0,
2053
+ sha256: "string",
2054
+ size_bytes: 48213
2055
+ }
2056
+ ],
2057
+ body_preview: "string",
2058
+ cc: [],
2059
+ dkim_result: "pass",
2060
+ dmarc_result: "pass",
2061
+ envelope_to: "support@in.example.com",
2062
+ from: "jane@example.org",
2063
+ id: "7d9c1e2a-3b4c-4d5e-8f6a-7b8c9d0e1f2a",
2064
+ mailbox_address: "support@in.example.com",
2065
+ mailbox_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
2066
+ read_at: "2026-01-01T00:00:00.000Z",
2067
+ received_at: "2026-01-01T00:00:00.000Z",
2068
+ rfc822_message_id: "<CAF1234@mail.gmail.com>",
2069
+ size_bytes: 5120,
2070
+ spam: false,
2071
+ spam_verdict: "ham",
2072
+ spf_result: "pass",
2073
+ subject: "Invoice #42",
2074
+ to: ["support@in.example.com"]
2075
+ } },
2076
+ { op: "segments.delete", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/segments\/[^\/]+$/, status: 204, contentType: null, body: null },
2077
+ { op: "segments.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/segments\/[^\/]+$/, status: 200, contentType: "application/json", body: {
2078
+ created_at: "2026-01-01T00:00:00.000Z",
2079
+ description: "string",
2080
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
2081
+ name: "Pro customers",
2082
+ rule: { conditions: [{ field: "plan", operator: "equals", value: "pro" }], match: "all" },
2083
+ type: "static",
2084
+ updated_at: "2026-01-01T00:00:00.000Z"
2085
+ } },
2086
+ { op: "segments.update", method: "PATCH", pattern: /^\/v1\/workspaces\/[^\/]+\/segments\/[^\/]+$/, status: 200, contentType: "application/json", body: {
2087
+ created_at: "2026-01-01T00:00:00.000Z",
2088
+ description: "string",
2089
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
2090
+ name: "Pro customers",
2091
+ rule: { conditions: [{ field: "plan", operator: "equals", value: "pro" }], match: "all" },
2092
+ type: "static",
2093
+ updated_at: "2026-01-01T00:00:00.000Z"
2094
+ } },
2095
+ { op: "domains.delete", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/domains\/[^\/]+$/, status: 204, contentType: null, body: null },
2096
+ { op: "domains.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/domains\/[^\/]+$/, status: 200, contentType: "application/json", body: {
2097
+ capabilities: { receiving: "disabled", sending: "enabled" },
2098
+ click_tracking: false,
2099
+ created_at: "2026-01-01T00:00:00.000Z",
2100
+ dkim_public_key: "string",
2101
+ dkim_selector: "string",
2102
+ dmarc_grade: {
2103
+ adkim: "r",
2104
+ aspf: "r",
2105
+ domain_policy: "none",
2106
+ host: "_dmarc.example.com",
2107
+ location: "subdomain",
2108
+ pct: 100,
2109
+ policy: "none",
2110
+ record: "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com",
2111
+ rua: ["mailto:dmarc@example.com"],
2112
+ subdomain_policy: "none",
2113
+ warning: "string"
2114
+ },
2115
+ dmarc_managed: true,
2116
+ dns_check_results: {},
2117
+ dns_instructions: [
2118
+ {
2119
+ host: "productcraft._domainkey.mail.example.com",
2120
+ priority: 1,
2121
+ purpose: "dkim",
2122
+ required: true,
2123
+ ttl: 1,
2124
+ type: "TXT",
2125
+ value: "string"
2126
+ }
2127
+ ],
2128
+ dns_provider: { id: "digitalocean", name: "DigitalOcean", source: "detected" },
2129
+ dns_provider_detected: "cloudflare",
2130
+ dns_provider_id: "cloudflare",
2131
+ dns_zone: "example.com",
2132
+ events: [
2133
+ {
2134
+ detail: { records: [{ purpose: "dkim", state: "missing" }] },
2135
+ domain_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
2136
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
2137
+ occurred_at: "2026-01-01T00:00:00.000Z",
2138
+ type: "verified"
2139
+ }
2140
+ ],
2141
+ fqdn: "productcraft.co",
2142
+ health: "ok",
2143
+ health_changed_at: "2026-01-01T00:00:00.000Z",
2144
+ health_grace_ends_at: "2026-01-01T00:00:00.000Z",
2145
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
2146
+ intent: "receive",
2147
+ last_dns_check_at: "2026-01-01T00:00:00.000Z",
2148
+ mail_from_status: "PENDING",
2149
+ mail_from_subdomain: "bounce",
2150
+ name: "productcraft.co",
2151
+ open_tracking: false,
2152
+ owner_account_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
2153
+ recommended_pending: 2,
2154
+ records: [
2155
+ {
2156
+ name: "productcraft._domainkey.mail",
2157
+ priority: 10,
2158
+ purpose: "dkim",
2159
+ record: "DKIM",
2160
+ required: true,
2161
+ status: "verified",
2162
+ ttl: 3600,
2163
+ type: "TXT",
2164
+ value: "string"
2165
+ }
2166
+ ],
2167
+ region: "eu-north-1",
2168
+ region_name: "Stockholm",
2169
+ seq_id: "3",
2170
+ ses_dkim_status: "PENDING",
2171
+ setup_method: null,
2172
+ status: "active",
2173
+ test_address: "test-abc123@productcraft.co",
2174
+ test_received_at: "2026-01-01T00:00:00.000Z",
2175
+ test_token: "string",
2176
+ tls: "opportunistic",
2177
+ tracking_subdomain: null,
2178
+ verification_status: "pending",
2179
+ verification_token: "string",
2180
+ verified_at: "2026-01-01T00:00:00.000Z",
2181
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
2182
+ } },
2183
+ { op: "domains.update", method: "PATCH", pattern: /^\/v1\/workspaces\/[^\/]+\/domains\/[^\/]+$/, status: 200, contentType: "application/json", body: {
2184
+ capabilities: { receiving: "disabled", sending: "enabled" },
2185
+ click_tracking: false,
2186
+ created_at: "2026-01-01T00:00:00.000Z",
2187
+ dkim_public_key: "string",
2188
+ dkim_selector: "string",
2189
+ dmarc_grade: {
2190
+ adkim: "r",
2191
+ aspf: "r",
2192
+ domain_policy: "none",
2193
+ host: "_dmarc.example.com",
2194
+ location: "subdomain",
2195
+ pct: 100,
2196
+ policy: "none",
2197
+ record: "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com",
2198
+ rua: ["mailto:dmarc@example.com"],
2199
+ subdomain_policy: "none",
2200
+ warning: "string"
2201
+ },
2202
+ dmarc_managed: true,
2203
+ dns_check_results: {},
2204
+ dns_instructions: [
2205
+ {
2206
+ host: "productcraft._domainkey.mail.example.com",
2207
+ priority: 1,
2208
+ purpose: "dkim",
2209
+ required: true,
2210
+ ttl: 1,
2211
+ type: "TXT",
2212
+ value: "string"
2213
+ }
2214
+ ],
2215
+ dns_provider: { id: "digitalocean", name: "DigitalOcean", source: "detected" },
2216
+ dns_provider_detected: "cloudflare",
2217
+ dns_provider_id: "cloudflare",
2218
+ dns_zone: "example.com",
2219
+ fqdn: "productcraft.co",
2220
+ health: "ok",
2221
+ health_changed_at: "2026-01-01T00:00:00.000Z",
2222
+ health_grace_ends_at: "2026-01-01T00:00:00.000Z",
2223
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
2224
+ intent: "receive",
2225
+ last_dns_check_at: "2026-01-01T00:00:00.000Z",
2226
+ mail_from_status: "PENDING",
2227
+ mail_from_subdomain: "bounce",
2228
+ name: "productcraft.co",
2229
+ open_tracking: false,
2230
+ owner_account_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
2231
+ recommended_pending: 2,
2232
+ records: [
2233
+ {
2234
+ name: "productcraft._domainkey.mail",
2235
+ priority: 10,
2236
+ purpose: "dkim",
2237
+ record: "DKIM",
2238
+ required: true,
2239
+ status: "verified",
2240
+ ttl: 3600,
2241
+ type: "TXT",
2242
+ value: "string"
2243
+ }
2244
+ ],
2245
+ region: "eu-north-1",
2246
+ region_name: "Stockholm",
2247
+ seq_id: "3",
2248
+ ses_dkim_status: "PENDING",
2249
+ setup_method: null,
2250
+ status: "pending",
2251
+ test_address: "test-abc123@productcraft.co",
2252
+ test_received_at: "2026-01-01T00:00:00.000Z",
2253
+ test_token: "string",
2254
+ tls: "opportunistic",
2255
+ tracking_subdomain: null,
2256
+ verification_status: "pending",
2257
+ verification_token: "string",
2258
+ verified_at: "2026-01-01T00:00:00.000Z",
2259
+ workspace_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
2260
+ } },
2261
+ { op: "emails.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/emails\/[^\/]+$/, status: 200, contentType: "application/json", body: {
2262
+ bcc: ["string"],
2263
+ cc: ["string"],
2264
+ created_at: "2026-01-01T00:00:00.000Z",
2265
+ from: "ada@example.com",
2266
+ headers: {},
2267
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
2268
+ last_event: "queued",
2269
+ messages: [{ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b", status: "queued", to: "ada@example.com" }],
2270
+ recipient_count: 1,
2271
+ reply_to: ["string"],
2272
+ subject: "string",
2273
+ tags: [{ name: "category", value: "confirm_email" }],
2274
+ template_name: "string",
2275
+ to: ["string"]
2276
+ } },
2277
+ { op: "topics.delete", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/topics\/[^\/]+$/, status: 204, contentType: null, body: null },
2278
+ { op: "topics.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/topics\/[^\/]+$/, status: 200, contentType: "application/json", body: {
2279
+ created_at: "2026-01-01T00:00:00.000Z",
2280
+ default_subscription: "opt_in",
2281
+ description: "string",
2282
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
2283
+ name: "Product updates",
2284
+ updated_at: "2026-01-01T00:00:00.000Z",
2285
+ visibility: "public"
2286
+ } },
2287
+ { op: "topics.update", method: "PATCH", pattern: /^\/v1\/workspaces\/[^\/]+\/topics\/[^\/]+$/, status: 200, contentType: "application/json", body: {
2288
+ created_at: "2026-01-01T00:00:00.000Z",
2289
+ default_subscription: "opt_in",
2290
+ description: "string",
2291
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
2292
+ name: "Product updates",
2293
+ updated_at: "2026-01-01T00:00:00.000Z",
2294
+ visibility: "public"
2295
+ } },
2296
+ { op: "integrations.github.repos.branches.list", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/integrations\/github\/repos\/[^\/]+\/[^\/]+\/branches$/, status: 200, contentType: "application/json", body: [{ name: "string" }] },
2297
+ { op: "mailboxes.messages.read", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/mailboxes\/[^\/]+\/messages\/[^\/]+\/read$/, status: 204, contentType: null, body: null },
2298
+ { op: "mailboxes.messages.raw", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/mailboxes\/[^\/]+\/messages\/[^\/]+\/raw$/, status: 200, contentType: "message/rfc822", body: "" },
2299
+ { op: "received.attachments.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/received\/[^\/]+\/attachments\/[^\/]+$/, status: 200, contentType: "application/octet-stream", body: "" },
2300
+ { op: "domains.shareLinks.delete", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/domains\/[^\/]+\/share-links\/[^\/]+$/, status: 204, contentType: null, body: null },
2301
+ { op: "mailboxes.messages.delete", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/mailboxes\/[^\/]+\/messages\/[^\/]+$/, status: 204, contentType: null, body: null },
2302
+ { op: "mailboxes.messages.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/mailboxes\/[^\/]+\/messages\/[^\/]+$/, status: 200, contentType: "application/json", body: {
2303
+ attachments: [
2304
+ {
2305
+ content_id: "string",
2306
+ content_type: "string",
2307
+ filename: "string",
2308
+ position: 1,
2309
+ sha256: "string",
2310
+ size_bytes: 1
2311
+ }
2312
+ ],
2313
+ body_preview: "string",
2314
+ cc_addresses: ["string"],
2315
+ deleted_at: "2026-01-01T00:00:00.000Z",
2316
+ dkim_result: "string",
2317
+ dmarc_result: "string",
2318
+ envelope_to: "string",
2319
+ from_address: "string",
2320
+ from_domain: "string",
2321
+ from_local: "string",
2322
+ id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
2323
+ mailbox_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
2324
+ quarantined: true,
2325
+ raw_object_key: "string",
2326
+ read_at: "2026-01-01T00:00:00.000Z",
2327
+ received_at: "2026-01-01T00:00:00.000Z",
2328
+ rfc822_message_id: "string",
2329
+ seq_id: "42",
2330
+ size_bytes: 1,
2331
+ spam_score: "string",
2332
+ spam_verdict: "string",
2333
+ spf_result: "string",
2334
+ subject: "string",
2335
+ to_addresses: ["string"]
2336
+ } },
2337
+ { op: "contacts.segments.add", method: "POST", pattern: /^\/v1\/workspaces\/[^\/]+\/contacts\/[^\/]+\/segments\/[^\/]+$/, status: 201, contentType: "application/json", body: {
2338
+ added_at: "2026-01-01T00:00:00.000Z",
2339
+ contact_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b",
2340
+ segment_id: "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
2341
+ } },
2342
+ { op: "contacts.segments.delete", method: "DELETE", pattern: /^\/v1\/workspaces\/[^\/]+\/contacts\/[^\/]+\/segments\/[^\/]+$/, status: 204, contentType: null, body: null },
2343
+ { op: "mailboxes.messages.attachments.retrieve", method: "GET", pattern: /^\/v1\/workspaces\/[^\/]+\/mailboxes\/[^\/]+\/messages\/[^\/]+\/attachments\/[^\/]+$/, status: 200, contentType: "application/octet-stream", body: "" }
2344
+ ];
2345
+ function createMockFetch(overrides = {}) {
2346
+ const calls = [];
2347
+ const mock = async (input, init) => {
2348
+ const request = input instanceof Request ? input : void 0;
2349
+ const url = new URL(request ? request.url : String(input));
2350
+ const method = (init?.method ?? request?.method ?? "GET").toUpperCase();
2351
+ const headers = new Headers(init?.headers ?? request?.headers);
2352
+ const raw = init?.body ?? (request ? await request.text() : void 0);
2353
+ let body = raw;
2354
+ if (typeof raw === "string") {
2355
+ try {
2356
+ body = JSON.parse(raw);
2357
+ } catch {
2358
+ body = raw;
2359
+ }
2360
+ }
2361
+ const route = ROUTES.find((r) => r.method === method && r.pattern.test(url.pathname));
2362
+ const call = { operation: route?.op, method, url, headers, body };
2363
+ calls.push(call);
2364
+ const requestId = `req_mock_${calls.length}`;
2365
+ if (!route) {
2366
+ return Response.json({ statusCode: 404, code: "NOT_FOUND", message: `No mock for ${method} ${url.pathname}` }, { status: 404, headers: { "x-request-id": requestId } });
2367
+ }
2368
+ let value = route.body;
2369
+ if (route.op in overrides) {
2370
+ const o = overrides[route.op];
2371
+ value = typeof o === "function" ? await o(call) : o;
2372
+ if (value instanceof Response) return value;
2373
+ }
2374
+ if (route.contentType === null || route.status === 204) return new Response(null, { status: route.status, headers: { "x-request-id": requestId } });
2375
+ const text = route.contentType === "application/json" ? JSON.stringify(value) : String(value);
2376
+ return new Response(text, { status: route.status, headers: { "content-type": route.contentType, "x-request-id": requestId } });
2377
+ };
2378
+ return Object.assign(mock, { calls });
2379
+ }
2380
+
2381
+ exports.createMockFetch = createMockFetch;
2382
+ //# sourceMappingURL=testing.cjs.map
2383
+ //# sourceMappingURL=testing.cjs.map