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