@samva/webhooks 0.13.0 → 0.15.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,2750 @@
1
+ //#region src/json-schemas.gen.ts
2
+ const WebhookEventJsonSchemas = {
3
+ "message.sent": {
4
+ type: "object",
5
+ properties: {
6
+ type: {
7
+ type: "string",
8
+ enum: ["message.sent"]
9
+ },
10
+ timestamp: { type: "string" },
11
+ data: {
12
+ type: "object",
13
+ properties: {
14
+ mailboxId: { anyOf: [{ $ref: "#/$defs/MailboxId" }, { type: "null" }] },
15
+ channel: {
16
+ type: "string",
17
+ enum: [
18
+ "sms",
19
+ "whatsapp",
20
+ "email"
21
+ ]
22
+ },
23
+ status: { anyOf: [{ type: "string" }, { type: "null" }] },
24
+ metadata: { anyOf: [{ type: "object" }, { type: "null" }] },
25
+ cost: { anyOf: [{ type: "number" }, { type: "null" }] },
26
+ recipient: { anyOf: [{ type: "string" }, { type: "null" }] },
27
+ occurredAt: { anyOf: [{ type: "string" }, { type: "null" }] },
28
+ failureReason: { anyOf: [{ type: "string" }, { type: "null" }] },
29
+ errorCode: { anyOf: [{ type: "string" }, { type: "null" }] },
30
+ conversationId: { anyOf: [{ type: "string" }, { type: "null" }] },
31
+ isBillable: { anyOf: [{ type: "boolean" }, { type: "null" }] },
32
+ messageType: { anyOf: [{ type: "string" }, { type: "null" }] },
33
+ templateCategory: { anyOf: [{
34
+ type: "string",
35
+ enum: [
36
+ "marketing",
37
+ "utility",
38
+ "authentication"
39
+ ]
40
+ }, { type: "null" }] },
41
+ subject: { anyOf: [{ type: "string" }, { type: "null" }] },
42
+ toEmails: { anyOf: [{
43
+ type: "array",
44
+ items: { type: "string" }
45
+ }, { type: "null" }] },
46
+ providerMessageId: { anyOf: [{ type: "string" }, { type: "null" }] },
47
+ waId: { anyOf: [{ type: "string" }, { type: "null" }] },
48
+ hasAttachments: { anyOf: [{ type: "boolean" }, { type: "null" }] },
49
+ isAutoReply: { anyOf: [{ type: "boolean" }, { type: "null" }] },
50
+ segments: { anyOf: [{ type: "number" }, { type: "null" }] },
51
+ to: { anyOf: [{ type: "string" }, { type: "null" }] },
52
+ from: { anyOf: [{ type: "string" }, { type: "null" }] },
53
+ body: { anyOf: [{ type: "string" }, { type: "null" }] },
54
+ direction: { anyOf: [{
55
+ type: "string",
56
+ enum: ["inbound", "outbound"]
57
+ }, { type: "null" }] },
58
+ errorMessage: { anyOf: [{ type: "string" }, { type: "null" }] },
59
+ parts: { anyOf: [{ type: "number" }, { type: "null" }] },
60
+ carrier: { anyOf: [{ type: "string" }, { type: "null" }] },
61
+ messageId: { type: "string" },
62
+ organizationId: { type: "string" }
63
+ },
64
+ required: [
65
+ "channel",
66
+ "messageId",
67
+ "organizationId"
68
+ ],
69
+ additionalProperties: true
70
+ }
71
+ },
72
+ required: [
73
+ "type",
74
+ "timestamp",
75
+ "data"
76
+ ],
77
+ additionalProperties: true,
78
+ $defs: { MailboxId: {
79
+ type: "string",
80
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
81
+ } }
82
+ },
83
+ "message.delivered": {
84
+ type: "object",
85
+ properties: {
86
+ type: {
87
+ type: "string",
88
+ enum: ["message.delivered"]
89
+ },
90
+ timestamp: { type: "string" },
91
+ data: {
92
+ type: "object",
93
+ properties: {
94
+ mailboxId: { anyOf: [{ $ref: "#/$defs/MailboxId" }, { type: "null" }] },
95
+ channel: {
96
+ type: "string",
97
+ enum: [
98
+ "sms",
99
+ "whatsapp",
100
+ "email"
101
+ ]
102
+ },
103
+ status: { anyOf: [{ type: "string" }, { type: "null" }] },
104
+ metadata: { anyOf: [{ type: "object" }, { type: "null" }] },
105
+ cost: { anyOf: [{ type: "number" }, { type: "null" }] },
106
+ recipient: { anyOf: [{ type: "string" }, { type: "null" }] },
107
+ occurredAt: { anyOf: [{ type: "string" }, { type: "null" }] },
108
+ failureReason: { anyOf: [{ type: "string" }, { type: "null" }] },
109
+ errorCode: { anyOf: [{ type: "string" }, { type: "null" }] },
110
+ conversationId: { anyOf: [{ type: "string" }, { type: "null" }] },
111
+ isBillable: { anyOf: [{ type: "boolean" }, { type: "null" }] },
112
+ messageType: { anyOf: [{ type: "string" }, { type: "null" }] },
113
+ templateCategory: { anyOf: [{
114
+ type: "string",
115
+ enum: [
116
+ "marketing",
117
+ "utility",
118
+ "authentication"
119
+ ]
120
+ }, { type: "null" }] },
121
+ subject: { anyOf: [{ type: "string" }, { type: "null" }] },
122
+ toEmails: { anyOf: [{
123
+ type: "array",
124
+ items: { type: "string" }
125
+ }, { type: "null" }] },
126
+ providerMessageId: { anyOf: [{ type: "string" }, { type: "null" }] },
127
+ waId: { anyOf: [{ type: "string" }, { type: "null" }] },
128
+ hasAttachments: { anyOf: [{ type: "boolean" }, { type: "null" }] },
129
+ isAutoReply: { anyOf: [{ type: "boolean" }, { type: "null" }] },
130
+ segments: { anyOf: [{ type: "number" }, { type: "null" }] },
131
+ to: { anyOf: [{ type: "string" }, { type: "null" }] },
132
+ from: { anyOf: [{ type: "string" }, { type: "null" }] },
133
+ body: { anyOf: [{ type: "string" }, { type: "null" }] },
134
+ direction: { anyOf: [{
135
+ type: "string",
136
+ enum: ["inbound", "outbound"]
137
+ }, { type: "null" }] },
138
+ errorMessage: { anyOf: [{ type: "string" }, { type: "null" }] },
139
+ parts: { anyOf: [{ type: "number" }, { type: "null" }] },
140
+ carrier: { anyOf: [{ type: "string" }, { type: "null" }] },
141
+ messageId: { type: "string" },
142
+ organizationId: { type: "string" }
143
+ },
144
+ required: [
145
+ "channel",
146
+ "messageId",
147
+ "organizationId"
148
+ ],
149
+ additionalProperties: true
150
+ }
151
+ },
152
+ required: [
153
+ "type",
154
+ "timestamp",
155
+ "data"
156
+ ],
157
+ additionalProperties: true,
158
+ $defs: { MailboxId: {
159
+ type: "string",
160
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
161
+ } }
162
+ },
163
+ "message.read": {
164
+ type: "object",
165
+ properties: {
166
+ type: {
167
+ type: "string",
168
+ enum: ["message.read"]
169
+ },
170
+ timestamp: { type: "string" },
171
+ data: {
172
+ type: "object",
173
+ properties: {
174
+ mailboxId: { anyOf: [{ $ref: "#/$defs/MailboxId" }, { type: "null" }] },
175
+ channel: {
176
+ type: "string",
177
+ enum: [
178
+ "sms",
179
+ "whatsapp",
180
+ "email"
181
+ ]
182
+ },
183
+ status: { anyOf: [{ type: "string" }, { type: "null" }] },
184
+ metadata: { anyOf: [{ type: "object" }, { type: "null" }] },
185
+ cost: { anyOf: [{ type: "number" }, { type: "null" }] },
186
+ recipient: { anyOf: [{ type: "string" }, { type: "null" }] },
187
+ occurredAt: { anyOf: [{ type: "string" }, { type: "null" }] },
188
+ failureReason: { anyOf: [{ type: "string" }, { type: "null" }] },
189
+ errorCode: { anyOf: [{ type: "string" }, { type: "null" }] },
190
+ conversationId: { anyOf: [{ type: "string" }, { type: "null" }] },
191
+ isBillable: { anyOf: [{ type: "boolean" }, { type: "null" }] },
192
+ messageType: { anyOf: [{ type: "string" }, { type: "null" }] },
193
+ templateCategory: { anyOf: [{
194
+ type: "string",
195
+ enum: [
196
+ "marketing",
197
+ "utility",
198
+ "authentication"
199
+ ]
200
+ }, { type: "null" }] },
201
+ subject: { anyOf: [{ type: "string" }, { type: "null" }] },
202
+ toEmails: { anyOf: [{
203
+ type: "array",
204
+ items: { type: "string" }
205
+ }, { type: "null" }] },
206
+ providerMessageId: { anyOf: [{ type: "string" }, { type: "null" }] },
207
+ waId: { anyOf: [{ type: "string" }, { type: "null" }] },
208
+ hasAttachments: { anyOf: [{ type: "boolean" }, { type: "null" }] },
209
+ isAutoReply: { anyOf: [{ type: "boolean" }, { type: "null" }] },
210
+ segments: { anyOf: [{ type: "number" }, { type: "null" }] },
211
+ to: { anyOf: [{ type: "string" }, { type: "null" }] },
212
+ from: { anyOf: [{ type: "string" }, { type: "null" }] },
213
+ body: { anyOf: [{ type: "string" }, { type: "null" }] },
214
+ direction: { anyOf: [{
215
+ type: "string",
216
+ enum: ["inbound", "outbound"]
217
+ }, { type: "null" }] },
218
+ errorMessage: { anyOf: [{ type: "string" }, { type: "null" }] },
219
+ parts: { anyOf: [{ type: "number" }, { type: "null" }] },
220
+ carrier: { anyOf: [{ type: "string" }, { type: "null" }] },
221
+ messageId: { type: "string" },
222
+ organizationId: { type: "string" }
223
+ },
224
+ required: [
225
+ "channel",
226
+ "messageId",
227
+ "organizationId"
228
+ ],
229
+ additionalProperties: true
230
+ }
231
+ },
232
+ required: [
233
+ "type",
234
+ "timestamp",
235
+ "data"
236
+ ],
237
+ additionalProperties: true,
238
+ $defs: { MailboxId: {
239
+ type: "string",
240
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
241
+ } }
242
+ },
243
+ "message.failed": {
244
+ type: "object",
245
+ properties: {
246
+ type: {
247
+ type: "string",
248
+ enum: ["message.failed"]
249
+ },
250
+ timestamp: { type: "string" },
251
+ data: {
252
+ type: "object",
253
+ properties: {
254
+ mailboxId: { anyOf: [{ $ref: "#/$defs/MailboxId" }, { type: "null" }] },
255
+ channel: {
256
+ type: "string",
257
+ enum: [
258
+ "sms",
259
+ "whatsapp",
260
+ "email"
261
+ ]
262
+ },
263
+ status: { anyOf: [{ type: "string" }, { type: "null" }] },
264
+ metadata: { anyOf: [{ type: "object" }, { type: "null" }] },
265
+ cost: { anyOf: [{ type: "number" }, { type: "null" }] },
266
+ recipient: { anyOf: [{ type: "string" }, { type: "null" }] },
267
+ occurredAt: { anyOf: [{ type: "string" }, { type: "null" }] },
268
+ failureReason: { anyOf: [{ type: "string" }, { type: "null" }] },
269
+ errorCode: { anyOf: [{ type: "string" }, { type: "null" }] },
270
+ conversationId: { anyOf: [{ type: "string" }, { type: "null" }] },
271
+ isBillable: { anyOf: [{ type: "boolean" }, { type: "null" }] },
272
+ messageType: { anyOf: [{ type: "string" }, { type: "null" }] },
273
+ templateCategory: { anyOf: [{
274
+ type: "string",
275
+ enum: [
276
+ "marketing",
277
+ "utility",
278
+ "authentication"
279
+ ]
280
+ }, { type: "null" }] },
281
+ subject: { anyOf: [{ type: "string" }, { type: "null" }] },
282
+ toEmails: { anyOf: [{
283
+ type: "array",
284
+ items: { type: "string" }
285
+ }, { type: "null" }] },
286
+ providerMessageId: { anyOf: [{ type: "string" }, { type: "null" }] },
287
+ waId: { anyOf: [{ type: "string" }, { type: "null" }] },
288
+ hasAttachments: { anyOf: [{ type: "boolean" }, { type: "null" }] },
289
+ isAutoReply: { anyOf: [{ type: "boolean" }, { type: "null" }] },
290
+ segments: { anyOf: [{ type: "number" }, { type: "null" }] },
291
+ to: { anyOf: [{ type: "string" }, { type: "null" }] },
292
+ from: { anyOf: [{ type: "string" }, { type: "null" }] },
293
+ body: { anyOf: [{ type: "string" }, { type: "null" }] },
294
+ direction: { anyOf: [{
295
+ type: "string",
296
+ enum: ["inbound", "outbound"]
297
+ }, { type: "null" }] },
298
+ errorMessage: { anyOf: [{ type: "string" }, { type: "null" }] },
299
+ parts: { anyOf: [{ type: "number" }, { type: "null" }] },
300
+ carrier: { anyOf: [{ type: "string" }, { type: "null" }] },
301
+ messageId: { type: "string" },
302
+ organizationId: { type: "string" }
303
+ },
304
+ required: [
305
+ "channel",
306
+ "messageId",
307
+ "organizationId"
308
+ ],
309
+ additionalProperties: true
310
+ }
311
+ },
312
+ required: [
313
+ "type",
314
+ "timestamp",
315
+ "data"
316
+ ],
317
+ additionalProperties: true,
318
+ $defs: { MailboxId: {
319
+ type: "string",
320
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
321
+ } }
322
+ },
323
+ "message.bounced": {
324
+ type: "object",
325
+ properties: {
326
+ type: {
327
+ type: "string",
328
+ enum: ["message.bounced"]
329
+ },
330
+ timestamp: { type: "string" },
331
+ data: {
332
+ type: "object",
333
+ properties: {
334
+ mailboxId: { anyOf: [{ $ref: "#/$defs/MailboxId" }, { type: "null" }] },
335
+ channel: {
336
+ type: "string",
337
+ enum: [
338
+ "sms",
339
+ "whatsapp",
340
+ "email"
341
+ ]
342
+ },
343
+ status: { anyOf: [{ type: "string" }, { type: "null" }] },
344
+ metadata: { anyOf: [{ type: "object" }, { type: "null" }] },
345
+ cost: { anyOf: [{ type: "number" }, { type: "null" }] },
346
+ recipient: { type: "string" },
347
+ occurredAt: { type: "string" },
348
+ failureReason: { anyOf: [{ type: "string" }, { type: "null" }] },
349
+ errorCode: { anyOf: [{ type: "string" }, { type: "null" }] },
350
+ conversationId: { anyOf: [{ type: "string" }, { type: "null" }] },
351
+ isBillable: { anyOf: [{ type: "boolean" }, { type: "null" }] },
352
+ messageType: { anyOf: [{ type: "string" }, { type: "null" }] },
353
+ templateCategory: { anyOf: [{
354
+ type: "string",
355
+ enum: [
356
+ "marketing",
357
+ "utility",
358
+ "authentication"
359
+ ]
360
+ }, { type: "null" }] },
361
+ subject: { anyOf: [{ type: "string" }, { type: "null" }] },
362
+ toEmails: { anyOf: [{
363
+ type: "array",
364
+ items: { type: "string" }
365
+ }, { type: "null" }] },
366
+ providerMessageId: { anyOf: [{ type: "string" }, { type: "null" }] },
367
+ waId: { anyOf: [{ type: "string" }, { type: "null" }] },
368
+ hasAttachments: { anyOf: [{ type: "boolean" }, { type: "null" }] },
369
+ isAutoReply: { anyOf: [{ type: "boolean" }, { type: "null" }] },
370
+ segments: { anyOf: [{ type: "number" }, { type: "null" }] },
371
+ to: { anyOf: [{ type: "string" }, { type: "null" }] },
372
+ from: { anyOf: [{ type: "string" }, { type: "null" }] },
373
+ body: { anyOf: [{ type: "string" }, { type: "null" }] },
374
+ direction: { anyOf: [{
375
+ type: "string",
376
+ enum: ["inbound", "outbound"]
377
+ }, { type: "null" }] },
378
+ errorMessage: { anyOf: [{ type: "string" }, { type: "null" }] },
379
+ parts: { anyOf: [{ type: "number" }, { type: "null" }] },
380
+ carrier: { anyOf: [{ type: "string" }, { type: "null" }] },
381
+ messageId: { type: "string" },
382
+ organizationId: { type: "string" }
383
+ },
384
+ required: [
385
+ "channel",
386
+ "recipient",
387
+ "occurredAt",
388
+ "messageId",
389
+ "organizationId"
390
+ ],
391
+ additionalProperties: true
392
+ }
393
+ },
394
+ required: [
395
+ "type",
396
+ "timestamp",
397
+ "data"
398
+ ],
399
+ additionalProperties: true,
400
+ $defs: { MailboxId: {
401
+ type: "string",
402
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
403
+ } }
404
+ },
405
+ "message.complained": {
406
+ type: "object",
407
+ properties: {
408
+ type: {
409
+ type: "string",
410
+ enum: ["message.complained"]
411
+ },
412
+ timestamp: { type: "string" },
413
+ data: {
414
+ type: "object",
415
+ properties: {
416
+ mailboxId: { anyOf: [{ $ref: "#/$defs/MailboxId" }, { type: "null" }] },
417
+ channel: {
418
+ type: "string",
419
+ enum: [
420
+ "sms",
421
+ "whatsapp",
422
+ "email"
423
+ ]
424
+ },
425
+ status: { anyOf: [{ type: "string" }, { type: "null" }] },
426
+ metadata: { anyOf: [{ type: "object" }, { type: "null" }] },
427
+ cost: { anyOf: [{ type: "number" }, { type: "null" }] },
428
+ recipient: { type: "string" },
429
+ occurredAt: { type: "string" },
430
+ failureReason: { anyOf: [{ type: "string" }, { type: "null" }] },
431
+ errorCode: { anyOf: [{ type: "string" }, { type: "null" }] },
432
+ conversationId: { anyOf: [{ type: "string" }, { type: "null" }] },
433
+ isBillable: { anyOf: [{ type: "boolean" }, { type: "null" }] },
434
+ messageType: { anyOf: [{ type: "string" }, { type: "null" }] },
435
+ templateCategory: { anyOf: [{
436
+ type: "string",
437
+ enum: [
438
+ "marketing",
439
+ "utility",
440
+ "authentication"
441
+ ]
442
+ }, { type: "null" }] },
443
+ subject: { anyOf: [{ type: "string" }, { type: "null" }] },
444
+ toEmails: { anyOf: [{
445
+ type: "array",
446
+ items: { type: "string" }
447
+ }, { type: "null" }] },
448
+ providerMessageId: { anyOf: [{ type: "string" }, { type: "null" }] },
449
+ waId: { anyOf: [{ type: "string" }, { type: "null" }] },
450
+ hasAttachments: { anyOf: [{ type: "boolean" }, { type: "null" }] },
451
+ isAutoReply: { anyOf: [{ type: "boolean" }, { type: "null" }] },
452
+ segments: { anyOf: [{ type: "number" }, { type: "null" }] },
453
+ to: { anyOf: [{ type: "string" }, { type: "null" }] },
454
+ from: { anyOf: [{ type: "string" }, { type: "null" }] },
455
+ body: { anyOf: [{ type: "string" }, { type: "null" }] },
456
+ direction: { anyOf: [{
457
+ type: "string",
458
+ enum: ["inbound", "outbound"]
459
+ }, { type: "null" }] },
460
+ errorMessage: { anyOf: [{ type: "string" }, { type: "null" }] },
461
+ parts: { anyOf: [{ type: "number" }, { type: "null" }] },
462
+ carrier: { anyOf: [{ type: "string" }, { type: "null" }] },
463
+ messageId: { type: "string" },
464
+ organizationId: { type: "string" }
465
+ },
466
+ required: [
467
+ "channel",
468
+ "recipient",
469
+ "occurredAt",
470
+ "messageId",
471
+ "organizationId"
472
+ ],
473
+ additionalProperties: true
474
+ }
475
+ },
476
+ required: [
477
+ "type",
478
+ "timestamp",
479
+ "data"
480
+ ],
481
+ additionalProperties: true,
482
+ $defs: { MailboxId: {
483
+ type: "string",
484
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
485
+ } }
486
+ },
487
+ "message.received": {
488
+ type: "object",
489
+ properties: {
490
+ type: {
491
+ type: "string",
492
+ enum: ["message.received"]
493
+ },
494
+ timestamp: { type: "string" },
495
+ data: {
496
+ type: "object",
497
+ properties: {
498
+ mailboxId: { anyOf: [{ $ref: "#/$defs/MailboxId" }, { type: "null" }] },
499
+ channel: {
500
+ type: "string",
501
+ enum: [
502
+ "sms",
503
+ "whatsapp",
504
+ "email"
505
+ ]
506
+ },
507
+ status: { anyOf: [{ type: "string" }, { type: "null" }] },
508
+ metadata: { anyOf: [{ type: "object" }, { type: "null" }] },
509
+ cost: { anyOf: [{ type: "number" }, { type: "null" }] },
510
+ recipient: { anyOf: [{ type: "string" }, { type: "null" }] },
511
+ occurredAt: { anyOf: [{ type: "string" }, { type: "null" }] },
512
+ failureReason: { anyOf: [{ type: "string" }, { type: "null" }] },
513
+ errorCode: { anyOf: [{ type: "string" }, { type: "null" }] },
514
+ conversationId: { anyOf: [{ type: "string" }, { type: "null" }] },
515
+ isBillable: { anyOf: [{ type: "boolean" }, { type: "null" }] },
516
+ messageType: { anyOf: [{ type: "string" }, { type: "null" }] },
517
+ templateCategory: { anyOf: [{
518
+ type: "string",
519
+ enum: [
520
+ "marketing",
521
+ "utility",
522
+ "authentication"
523
+ ]
524
+ }, { type: "null" }] },
525
+ subject: { anyOf: [{ type: "string" }, { type: "null" }] },
526
+ toEmails: { anyOf: [{
527
+ type: "array",
528
+ items: { type: "string" }
529
+ }, { type: "null" }] },
530
+ providerMessageId: { anyOf: [{ type: "string" }, { type: "null" }] },
531
+ waId: { anyOf: [{ type: "string" }, { type: "null" }] },
532
+ hasAttachments: { anyOf: [{ type: "boolean" }, { type: "null" }] },
533
+ isAutoReply: { anyOf: [{ type: "boolean" }, { type: "null" }] },
534
+ segments: { anyOf: [{ type: "number" }, { type: "null" }] },
535
+ to: { anyOf: [{ type: "string" }, { type: "null" }] },
536
+ from: { anyOf: [{ type: "string" }, { type: "null" }] },
537
+ body: { anyOf: [{ type: "string" }, { type: "null" }] },
538
+ direction: { anyOf: [{
539
+ type: "string",
540
+ enum: ["inbound", "outbound"]
541
+ }, { type: "null" }] },
542
+ errorMessage: { anyOf: [{ type: "string" }, { type: "null" }] },
543
+ parts: { anyOf: [{ type: "number" }, { type: "null" }] },
544
+ carrier: { anyOf: [{ type: "string" }, { type: "null" }] },
545
+ messageId: { type: "string" },
546
+ organizationId: { type: "string" }
547
+ },
548
+ required: [
549
+ "channel",
550
+ "messageId",
551
+ "organizationId"
552
+ ],
553
+ additionalProperties: true
554
+ }
555
+ },
556
+ required: [
557
+ "type",
558
+ "timestamp",
559
+ "data"
560
+ ],
561
+ additionalProperties: true,
562
+ $defs: { MailboxId: {
563
+ type: "string",
564
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
565
+ } }
566
+ },
567
+ "message.opened": {
568
+ type: "object",
569
+ properties: {
570
+ type: {
571
+ type: "string",
572
+ enum: ["message.opened"]
573
+ },
574
+ timestamp: { type: "string" },
575
+ data: {
576
+ type: "object",
577
+ properties: {
578
+ messageId: { $ref: "#/$defs/MessageId" },
579
+ organizationId: { $ref: "#/$defs/OrganizationId" },
580
+ channel: {
581
+ type: "string",
582
+ enum: ["email"]
583
+ },
584
+ deliveryId: { $ref: "#/$defs/MessageDeliveryId" },
585
+ recipient: { type: "string" },
586
+ occurredAt: { type: "string" },
587
+ userAgent: { anyOf: [{ type: "string" }, { type: "null" }] },
588
+ ipAddress: { anyOf: [{ type: "string" }, { type: "null" }] },
589
+ firstOpen: { type: "boolean" },
590
+ machine: { type: "boolean" },
591
+ machineReason: { anyOf: [{
592
+ type: "string",
593
+ enum: [
594
+ "google-image-proxy",
595
+ "apple-mail-privacy",
596
+ "scanner-user-agent",
597
+ "scanner-asn",
598
+ "too-fast"
599
+ ]
600
+ }, { type: "null" }] },
601
+ country: { anyOf: [{ type: "string" }, { type: "null" }] },
602
+ city: { anyOf: [{ type: "string" }, { type: "null" }] },
603
+ asn: { anyOf: [{ type: "number" }, { type: "null" }] },
604
+ code: { anyOf: [{ type: "string" }, { type: "null" }] },
605
+ linkIndex: { anyOf: [{ type: "number" }, { type: "null" }] },
606
+ destinationUrl: { anyOf: [{ type: "string" }, { type: "null" }] },
607
+ metadata: { anyOf: [{ type: "object" }, { type: "null" }] },
608
+ campaignId: { anyOf: [{ $ref: "#/$defs/CampaignId" }, { type: "null" }] },
609
+ campaignRunId: { anyOf: [{ $ref: "#/$defs/CampaignRunId" }, { type: "null" }] }
610
+ },
611
+ required: [
612
+ "messageId",
613
+ "organizationId",
614
+ "channel",
615
+ "deliveryId",
616
+ "recipient",
617
+ "occurredAt",
618
+ "firstOpen",
619
+ "machine",
620
+ "machineReason"
621
+ ],
622
+ additionalProperties: true
623
+ }
624
+ },
625
+ required: [
626
+ "type",
627
+ "timestamp",
628
+ "data"
629
+ ],
630
+ additionalProperties: true,
631
+ $defs: {
632
+ MessageId: {
633
+ type: "string",
634
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
635
+ },
636
+ OrganizationId: {
637
+ type: "string",
638
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
639
+ },
640
+ MessageDeliveryId: {
641
+ type: "string",
642
+ pattern: "^mdel_[0-9a-hjkmnp-tv-z]{16,24}$"
643
+ },
644
+ CampaignId: {
645
+ type: "string",
646
+ pattern: "^camp_[0-9a-hjkmnp-tv-z]{16,24}$"
647
+ },
648
+ CampaignRunId: {
649
+ type: "string",
650
+ pattern: "^crun_[0-9a-hjkmnp-tv-z]{16,24}$"
651
+ }
652
+ }
653
+ },
654
+ "message.clicked": {
655
+ type: "object",
656
+ properties: {
657
+ type: {
658
+ type: "string",
659
+ enum: ["message.clicked"]
660
+ },
661
+ timestamp: { type: "string" },
662
+ data: {
663
+ type: "object",
664
+ properties: {
665
+ messageId: { $ref: "#/$defs/MessageId" },
666
+ organizationId: { $ref: "#/$defs/OrganizationId" },
667
+ channel: {
668
+ type: "string",
669
+ enum: ["email"]
670
+ },
671
+ deliveryId: { $ref: "#/$defs/MessageDeliveryId" },
672
+ recipient: { type: "string" },
673
+ occurredAt: { type: "string" },
674
+ userAgent: { anyOf: [{ type: "string" }, { type: "null" }] },
675
+ ipAddress: { anyOf: [{ type: "string" }, { type: "null" }] },
676
+ url: { type: "string" },
677
+ linkTags: {
678
+ type: "object",
679
+ additionalProperties: {
680
+ type: "array",
681
+ items: { type: "string" }
682
+ }
683
+ },
684
+ firstClick: { type: "boolean" },
685
+ machine: { type: "boolean" },
686
+ machineReason: { anyOf: [{
687
+ type: "string",
688
+ enum: [
689
+ "google-image-proxy",
690
+ "apple-mail-privacy",
691
+ "scanner-user-agent",
692
+ "scanner-asn",
693
+ "too-fast"
694
+ ]
695
+ }, { type: "null" }] },
696
+ country: { anyOf: [{ type: "string" }, { type: "null" }] },
697
+ city: { anyOf: [{ type: "string" }, { type: "null" }] },
698
+ asn: { anyOf: [{ type: "number" }, { type: "null" }] },
699
+ code: { anyOf: [{ type: "string" }, { type: "null" }] },
700
+ linkIndex: { anyOf: [{ type: "number" }, { type: "null" }] },
701
+ destinationUrl: { anyOf: [{ type: "string" }, { type: "null" }] },
702
+ metadata: { anyOf: [{ type: "object" }, { type: "null" }] },
703
+ campaignId: { anyOf: [{ $ref: "#/$defs/CampaignId" }, { type: "null" }] },
704
+ campaignRunId: { anyOf: [{ $ref: "#/$defs/CampaignRunId" }, { type: "null" }] }
705
+ },
706
+ required: [
707
+ "messageId",
708
+ "organizationId",
709
+ "channel",
710
+ "deliveryId",
711
+ "recipient",
712
+ "occurredAt",
713
+ "url",
714
+ "linkTags",
715
+ "firstClick",
716
+ "machine",
717
+ "machineReason"
718
+ ],
719
+ additionalProperties: true
720
+ }
721
+ },
722
+ required: [
723
+ "type",
724
+ "timestamp",
725
+ "data"
726
+ ],
727
+ additionalProperties: true,
728
+ $defs: {
729
+ MessageId: {
730
+ type: "string",
731
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
732
+ },
733
+ OrganizationId: {
734
+ type: "string",
735
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
736
+ },
737
+ MessageDeliveryId: {
738
+ type: "string",
739
+ pattern: "^mdel_[0-9a-hjkmnp-tv-z]{16,24}$"
740
+ },
741
+ CampaignId: {
742
+ type: "string",
743
+ pattern: "^camp_[0-9a-hjkmnp-tv-z]{16,24}$"
744
+ },
745
+ CampaignRunId: {
746
+ type: "string",
747
+ pattern: "^crun_[0-9a-hjkmnp-tv-z]{16,24}$"
748
+ }
749
+ }
750
+ },
751
+ "contact.created": {
752
+ type: "object",
753
+ properties: {
754
+ type: {
755
+ type: "string",
756
+ enum: ["contact.created"]
757
+ },
758
+ timestamp: { type: "string" },
759
+ data: {
760
+ type: "object",
761
+ properties: {
762
+ contactId: { $ref: "#/$defs/ContactId" },
763
+ status: {
764
+ type: "string",
765
+ enum: [
766
+ "active",
767
+ "paused",
768
+ "blocked",
769
+ "archived"
770
+ ]
771
+ },
772
+ name: { type: "string" },
773
+ displayName: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
774
+ identities: {
775
+ type: "array",
776
+ items: { $ref: "#/$defs/ContactEventIdentity" }
777
+ },
778
+ tags: {
779
+ type: "array",
780
+ items: { type: "string" }
781
+ },
782
+ externalId: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
783
+ createdAt: { type: "string" },
784
+ updatedAt: { type: "string" }
785
+ },
786
+ required: [
787
+ "contactId",
788
+ "status",
789
+ "name",
790
+ "identities",
791
+ "tags",
792
+ "createdAt",
793
+ "updatedAt"
794
+ ],
795
+ additionalProperties: true
796
+ }
797
+ },
798
+ required: [
799
+ "type",
800
+ "timestamp",
801
+ "data"
802
+ ],
803
+ additionalProperties: true,
804
+ $defs: {
805
+ ContactId: {
806
+ type: "string",
807
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
808
+ },
809
+ ContactEventIdentity: {
810
+ type: "object",
811
+ properties: {
812
+ channel: {
813
+ type: "string",
814
+ enum: [
815
+ "sms",
816
+ "whatsapp",
817
+ "email"
818
+ ]
819
+ },
820
+ identifier: { type: "string" },
821
+ verified: { type: "boolean" }
822
+ },
823
+ required: [
824
+ "channel",
825
+ "identifier",
826
+ "verified"
827
+ ],
828
+ additionalProperties: true
829
+ }
830
+ }
831
+ },
832
+ "contact.updated": {
833
+ type: "object",
834
+ properties: {
835
+ type: {
836
+ type: "string",
837
+ enum: ["contact.updated"]
838
+ },
839
+ timestamp: { type: "string" },
840
+ data: {
841
+ type: "object",
842
+ properties: {
843
+ contactId: { $ref: "#/$defs/ContactId" },
844
+ status: {
845
+ type: "string",
846
+ enum: [
847
+ "active",
848
+ "paused",
849
+ "blocked",
850
+ "archived"
851
+ ]
852
+ },
853
+ name: { type: "string" },
854
+ displayName: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
855
+ identities: {
856
+ type: "array",
857
+ items: { $ref: "#/$defs/ContactEventIdentity" }
858
+ },
859
+ tags: {
860
+ type: "array",
861
+ items: { type: "string" }
862
+ },
863
+ externalId: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
864
+ createdAt: { type: "string" },
865
+ updatedAt: { type: "string" }
866
+ },
867
+ required: [
868
+ "contactId",
869
+ "status",
870
+ "name",
871
+ "identities",
872
+ "tags",
873
+ "createdAt",
874
+ "updatedAt"
875
+ ],
876
+ additionalProperties: true
877
+ }
878
+ },
879
+ required: [
880
+ "type",
881
+ "timestamp",
882
+ "data"
883
+ ],
884
+ additionalProperties: true,
885
+ $defs: {
886
+ ContactId: {
887
+ type: "string",
888
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
889
+ },
890
+ ContactEventIdentity: {
891
+ type: "object",
892
+ properties: {
893
+ channel: {
894
+ type: "string",
895
+ enum: [
896
+ "sms",
897
+ "whatsapp",
898
+ "email"
899
+ ]
900
+ },
901
+ identifier: { type: "string" },
902
+ verified: { type: "boolean" }
903
+ },
904
+ required: [
905
+ "channel",
906
+ "identifier",
907
+ "verified"
908
+ ],
909
+ additionalProperties: true
910
+ }
911
+ }
912
+ },
913
+ "contact.deleted": {
914
+ type: "object",
915
+ properties: {
916
+ type: {
917
+ type: "string",
918
+ enum: ["contact.deleted"]
919
+ },
920
+ timestamp: { type: "string" },
921
+ data: {
922
+ type: "object",
923
+ properties: {
924
+ contactId: { $ref: "#/$defs/ContactId" },
925
+ status: {
926
+ type: "string",
927
+ enum: [
928
+ "active",
929
+ "paused",
930
+ "blocked",
931
+ "archived"
932
+ ]
933
+ },
934
+ name: { type: "string" },
935
+ displayName: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
936
+ identities: {
937
+ type: "array",
938
+ items: { $ref: "#/$defs/ContactEventIdentity" }
939
+ },
940
+ tags: {
941
+ type: "array",
942
+ items: { type: "string" }
943
+ },
944
+ externalId: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
945
+ createdAt: { type: "string" },
946
+ updatedAt: { type: "string" }
947
+ },
948
+ required: [
949
+ "contactId",
950
+ "status",
951
+ "name",
952
+ "identities",
953
+ "tags",
954
+ "createdAt",
955
+ "updatedAt"
956
+ ],
957
+ additionalProperties: true
958
+ }
959
+ },
960
+ required: [
961
+ "type",
962
+ "timestamp",
963
+ "data"
964
+ ],
965
+ additionalProperties: true,
966
+ $defs: {
967
+ ContactId: {
968
+ type: "string",
969
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
970
+ },
971
+ ContactEventIdentity: {
972
+ type: "object",
973
+ properties: {
974
+ channel: {
975
+ type: "string",
976
+ enum: [
977
+ "sms",
978
+ "whatsapp",
979
+ "email"
980
+ ]
981
+ },
982
+ identifier: { type: "string" },
983
+ verified: { type: "boolean" }
984
+ },
985
+ required: [
986
+ "channel",
987
+ "identifier",
988
+ "verified"
989
+ ],
990
+ additionalProperties: true
991
+ }
992
+ }
993
+ },
994
+ "contact.subscribed": {
995
+ type: "object",
996
+ properties: {
997
+ type: {
998
+ type: "string",
999
+ enum: ["contact.subscribed"]
1000
+ },
1001
+ timestamp: { type: "string" },
1002
+ data: {
1003
+ type: "object",
1004
+ properties: {
1005
+ organizationId: { $ref: "#/$defs/OrganizationId" },
1006
+ contactId: { anyOf: [{ type: "string" }, { type: "null" }] },
1007
+ email: { type: "string" },
1008
+ groupId: { type: "string" },
1009
+ groupName: { type: "string" },
1010
+ contactGroupId: { anyOf: [{ $ref: "#/$defs/ContactGroupId" }, { type: "null" }] },
1011
+ unsubscribeGroupId: { anyOf: [{ $ref: "#/$defs/UnsubscribeId" }, { type: "null" }] },
1012
+ consentIp: { anyOf: [{ type: "string" }, { type: "null" }] },
1013
+ consentSource: { anyOf: [{ type: "string" }, { type: "null" }] },
1014
+ source: {
1015
+ type: "string",
1016
+ enum: [
1017
+ "link",
1018
+ "api",
1019
+ "manual",
1020
+ "complaint"
1021
+ ]
1022
+ },
1023
+ messageId: { anyOf: [{ $ref: "#/$defs/MessageId" }, { type: "null" }] },
1024
+ campaignId: { anyOf: [{ $ref: "#/$defs/CampaignId" }, { type: "null" }] },
1025
+ campaignRunId: { anyOf: [{ $ref: "#/$defs/CampaignRunId" }, { type: "null" }] },
1026
+ occurredAt: { type: "string" }
1027
+ },
1028
+ required: [
1029
+ "organizationId",
1030
+ "contactId",
1031
+ "email",
1032
+ "groupId",
1033
+ "groupName",
1034
+ "source",
1035
+ "occurredAt"
1036
+ ],
1037
+ additionalProperties: true
1038
+ }
1039
+ },
1040
+ required: [
1041
+ "type",
1042
+ "timestamp",
1043
+ "data"
1044
+ ],
1045
+ additionalProperties: true,
1046
+ $defs: {
1047
+ OrganizationId: {
1048
+ type: "string",
1049
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1050
+ },
1051
+ ContactGroupId: {
1052
+ type: "string",
1053
+ pattern: "^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$"
1054
+ },
1055
+ UnsubscribeId: {
1056
+ type: "string",
1057
+ pattern: "^unsub_[0-9a-hjkmnp-tv-z]{16,24}$"
1058
+ },
1059
+ MessageId: {
1060
+ type: "string",
1061
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
1062
+ },
1063
+ CampaignId: {
1064
+ type: "string",
1065
+ pattern: "^camp_[0-9a-hjkmnp-tv-z]{16,24}$"
1066
+ },
1067
+ CampaignRunId: {
1068
+ type: "string",
1069
+ pattern: "^crun_[0-9a-hjkmnp-tv-z]{16,24}$"
1070
+ }
1071
+ }
1072
+ },
1073
+ "contact.unsubscribed": {
1074
+ type: "object",
1075
+ properties: {
1076
+ type: {
1077
+ type: "string",
1078
+ enum: ["contact.unsubscribed"]
1079
+ },
1080
+ timestamp: { type: "string" },
1081
+ data: {
1082
+ type: "object",
1083
+ properties: {
1084
+ organizationId: { $ref: "#/$defs/OrganizationId" },
1085
+ contactId: { anyOf: [{ type: "string" }, { type: "null" }] },
1086
+ email: { type: "string" },
1087
+ groupId: { type: "string" },
1088
+ groupName: { type: "string" },
1089
+ contactGroupId: { anyOf: [{ $ref: "#/$defs/ContactGroupId" }, { type: "null" }] },
1090
+ unsubscribeGroupId: { anyOf: [{ $ref: "#/$defs/UnsubscribeId" }, { type: "null" }] },
1091
+ consentIp: { anyOf: [{ type: "string" }, { type: "null" }] },
1092
+ consentSource: { anyOf: [{ type: "string" }, { type: "null" }] },
1093
+ source: {
1094
+ type: "string",
1095
+ enum: [
1096
+ "link",
1097
+ "api",
1098
+ "manual",
1099
+ "complaint"
1100
+ ]
1101
+ },
1102
+ messageId: { anyOf: [{ $ref: "#/$defs/MessageId" }, { type: "null" }] },
1103
+ campaignId: { anyOf: [{ $ref: "#/$defs/CampaignId" }, { type: "null" }] },
1104
+ campaignRunId: { anyOf: [{ $ref: "#/$defs/CampaignRunId" }, { type: "null" }] },
1105
+ occurredAt: { type: "string" }
1106
+ },
1107
+ required: [
1108
+ "organizationId",
1109
+ "contactId",
1110
+ "email",
1111
+ "groupId",
1112
+ "groupName",
1113
+ "source",
1114
+ "occurredAt"
1115
+ ],
1116
+ additionalProperties: true
1117
+ }
1118
+ },
1119
+ required: [
1120
+ "type",
1121
+ "timestamp",
1122
+ "data"
1123
+ ],
1124
+ additionalProperties: true,
1125
+ $defs: {
1126
+ OrganizationId: {
1127
+ type: "string",
1128
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1129
+ },
1130
+ ContactGroupId: {
1131
+ type: "string",
1132
+ pattern: "^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$"
1133
+ },
1134
+ UnsubscribeId: {
1135
+ type: "string",
1136
+ pattern: "^unsub_[0-9a-hjkmnp-tv-z]{16,24}$"
1137
+ },
1138
+ MessageId: {
1139
+ type: "string",
1140
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
1141
+ },
1142
+ CampaignId: {
1143
+ type: "string",
1144
+ pattern: "^camp_[0-9a-hjkmnp-tv-z]{16,24}$"
1145
+ },
1146
+ CampaignRunId: {
1147
+ type: "string",
1148
+ pattern: "^crun_[0-9a-hjkmnp-tv-z]{16,24}$"
1149
+ }
1150
+ }
1151
+ },
1152
+ "contact.resubscribed": {
1153
+ type: "object",
1154
+ properties: {
1155
+ type: {
1156
+ type: "string",
1157
+ enum: ["contact.resubscribed"]
1158
+ },
1159
+ timestamp: { type: "string" },
1160
+ data: {
1161
+ type: "object",
1162
+ properties: {
1163
+ organizationId: { $ref: "#/$defs/OrganizationId" },
1164
+ contactId: { anyOf: [{ type: "string" }, { type: "null" }] },
1165
+ email: { type: "string" },
1166
+ groupId: { type: "string" },
1167
+ groupName: { type: "string" },
1168
+ contactGroupId: { anyOf: [{ $ref: "#/$defs/ContactGroupId" }, { type: "null" }] },
1169
+ unsubscribeGroupId: { anyOf: [{ $ref: "#/$defs/UnsubscribeId" }, { type: "null" }] },
1170
+ consentIp: { anyOf: [{ type: "string" }, { type: "null" }] },
1171
+ consentSource: { anyOf: [{ type: "string" }, { type: "null" }] },
1172
+ source: {
1173
+ type: "string",
1174
+ enum: [
1175
+ "link",
1176
+ "api",
1177
+ "manual",
1178
+ "complaint"
1179
+ ]
1180
+ },
1181
+ messageId: { anyOf: [{ $ref: "#/$defs/MessageId" }, { type: "null" }] },
1182
+ campaignId: { anyOf: [{ $ref: "#/$defs/CampaignId" }, { type: "null" }] },
1183
+ campaignRunId: { anyOf: [{ $ref: "#/$defs/CampaignRunId" }, { type: "null" }] },
1184
+ occurredAt: { type: "string" }
1185
+ },
1186
+ required: [
1187
+ "organizationId",
1188
+ "contactId",
1189
+ "email",
1190
+ "groupId",
1191
+ "groupName",
1192
+ "source",
1193
+ "occurredAt"
1194
+ ],
1195
+ additionalProperties: true
1196
+ }
1197
+ },
1198
+ required: [
1199
+ "type",
1200
+ "timestamp",
1201
+ "data"
1202
+ ],
1203
+ additionalProperties: true,
1204
+ $defs: {
1205
+ OrganizationId: {
1206
+ type: "string",
1207
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1208
+ },
1209
+ ContactGroupId: {
1210
+ type: "string",
1211
+ pattern: "^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$"
1212
+ },
1213
+ UnsubscribeId: {
1214
+ type: "string",
1215
+ pattern: "^unsub_[0-9a-hjkmnp-tv-z]{16,24}$"
1216
+ },
1217
+ MessageId: {
1218
+ type: "string",
1219
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
1220
+ },
1221
+ CampaignId: {
1222
+ type: "string",
1223
+ pattern: "^camp_[0-9a-hjkmnp-tv-z]{16,24}$"
1224
+ },
1225
+ CampaignRunId: {
1226
+ type: "string",
1227
+ pattern: "^crun_[0-9a-hjkmnp-tv-z]{16,24}$"
1228
+ }
1229
+ }
1230
+ },
1231
+ "conversation.created": {
1232
+ type: "object",
1233
+ properties: {
1234
+ type: {
1235
+ type: "string",
1236
+ enum: ["conversation.created"]
1237
+ },
1238
+ timestamp: { type: "string" },
1239
+ data: {
1240
+ type: "object",
1241
+ properties: {
1242
+ conversationId: { $ref: "#/$defs/ConversationId" },
1243
+ organizationId: { $ref: "#/$defs/OrganizationId" },
1244
+ title: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
1245
+ channels: {
1246
+ type: "array",
1247
+ items: {
1248
+ type: "string",
1249
+ enum: [
1250
+ "sms",
1251
+ "whatsapp",
1252
+ "email"
1253
+ ]
1254
+ }
1255
+ },
1256
+ primaryChannel: {
1257
+ type: "string",
1258
+ enum: [
1259
+ "sms",
1260
+ "whatsapp",
1261
+ "email"
1262
+ ]
1263
+ },
1264
+ status: {
1265
+ type: "string",
1266
+ enum: [
1267
+ "active",
1268
+ "waiting",
1269
+ "resolved",
1270
+ "escalated",
1271
+ "archived"
1272
+ ]
1273
+ },
1274
+ primaryContactId: { anyOf: [{ anyOf: [{ $ref: "#/$defs/ContactId" }, { type: "null" }] }, { type: "null" }] },
1275
+ createdAt: { type: "string" },
1276
+ updatedAt: { type: "string" }
1277
+ },
1278
+ required: [
1279
+ "conversationId",
1280
+ "organizationId",
1281
+ "channels",
1282
+ "primaryChannel",
1283
+ "status",
1284
+ "createdAt",
1285
+ "updatedAt"
1286
+ ],
1287
+ additionalProperties: true
1288
+ }
1289
+ },
1290
+ required: [
1291
+ "type",
1292
+ "timestamp",
1293
+ "data"
1294
+ ],
1295
+ additionalProperties: true,
1296
+ $defs: {
1297
+ ConversationId: {
1298
+ type: "string",
1299
+ pattern: "^conv_[0-9a-hjkmnp-tv-z]{16,24}$"
1300
+ },
1301
+ OrganizationId: {
1302
+ type: "string",
1303
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1304
+ },
1305
+ ContactId: {
1306
+ type: "string",
1307
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
1308
+ }
1309
+ }
1310
+ },
1311
+ "conversation.updated": {
1312
+ type: "object",
1313
+ properties: {
1314
+ type: {
1315
+ type: "string",
1316
+ enum: ["conversation.updated"]
1317
+ },
1318
+ timestamp: { type: "string" },
1319
+ data: {
1320
+ type: "object",
1321
+ properties: {
1322
+ conversationId: { $ref: "#/$defs/ConversationId" },
1323
+ organizationId: { $ref: "#/$defs/OrganizationId" },
1324
+ title: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
1325
+ channels: {
1326
+ type: "array",
1327
+ items: {
1328
+ type: "string",
1329
+ enum: [
1330
+ "sms",
1331
+ "whatsapp",
1332
+ "email"
1333
+ ]
1334
+ }
1335
+ },
1336
+ primaryChannel: {
1337
+ type: "string",
1338
+ enum: [
1339
+ "sms",
1340
+ "whatsapp",
1341
+ "email"
1342
+ ]
1343
+ },
1344
+ status: {
1345
+ type: "string",
1346
+ enum: [
1347
+ "active",
1348
+ "waiting",
1349
+ "resolved",
1350
+ "escalated",
1351
+ "archived"
1352
+ ]
1353
+ },
1354
+ primaryContactId: { anyOf: [{ anyOf: [{ $ref: "#/$defs/ContactId" }, { type: "null" }] }, { type: "null" }] },
1355
+ createdAt: { type: "string" },
1356
+ updatedAt: { type: "string" }
1357
+ },
1358
+ required: [
1359
+ "conversationId",
1360
+ "organizationId",
1361
+ "channels",
1362
+ "primaryChannel",
1363
+ "status",
1364
+ "createdAt",
1365
+ "updatedAt"
1366
+ ],
1367
+ additionalProperties: true
1368
+ }
1369
+ },
1370
+ required: [
1371
+ "type",
1372
+ "timestamp",
1373
+ "data"
1374
+ ],
1375
+ additionalProperties: true,
1376
+ $defs: {
1377
+ ConversationId: {
1378
+ type: "string",
1379
+ pattern: "^conv_[0-9a-hjkmnp-tv-z]{16,24}$"
1380
+ },
1381
+ OrganizationId: {
1382
+ type: "string",
1383
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1384
+ },
1385
+ ContactId: {
1386
+ type: "string",
1387
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
1388
+ }
1389
+ }
1390
+ },
1391
+ "conversation.archived": {
1392
+ type: "object",
1393
+ properties: {
1394
+ type: {
1395
+ type: "string",
1396
+ enum: ["conversation.archived"]
1397
+ },
1398
+ timestamp: { type: "string" },
1399
+ data: {
1400
+ type: "object",
1401
+ properties: {
1402
+ conversationId: { $ref: "#/$defs/ConversationId" },
1403
+ organizationId: { $ref: "#/$defs/OrganizationId" },
1404
+ title: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
1405
+ channels: {
1406
+ type: "array",
1407
+ items: {
1408
+ type: "string",
1409
+ enum: [
1410
+ "sms",
1411
+ "whatsapp",
1412
+ "email"
1413
+ ]
1414
+ }
1415
+ },
1416
+ primaryChannel: {
1417
+ type: "string",
1418
+ enum: [
1419
+ "sms",
1420
+ "whatsapp",
1421
+ "email"
1422
+ ]
1423
+ },
1424
+ status: {
1425
+ type: "string",
1426
+ enum: [
1427
+ "active",
1428
+ "waiting",
1429
+ "resolved",
1430
+ "escalated",
1431
+ "archived"
1432
+ ]
1433
+ },
1434
+ primaryContactId: { anyOf: [{ anyOf: [{ $ref: "#/$defs/ContactId" }, { type: "null" }] }, { type: "null" }] },
1435
+ createdAt: { type: "string" },
1436
+ updatedAt: { type: "string" }
1437
+ },
1438
+ required: [
1439
+ "conversationId",
1440
+ "organizationId",
1441
+ "channels",
1442
+ "primaryChannel",
1443
+ "status",
1444
+ "createdAt",
1445
+ "updatedAt"
1446
+ ],
1447
+ additionalProperties: true
1448
+ }
1449
+ },
1450
+ required: [
1451
+ "type",
1452
+ "timestamp",
1453
+ "data"
1454
+ ],
1455
+ additionalProperties: true,
1456
+ $defs: {
1457
+ ConversationId: {
1458
+ type: "string",
1459
+ pattern: "^conv_[0-9a-hjkmnp-tv-z]{16,24}$"
1460
+ },
1461
+ OrganizationId: {
1462
+ type: "string",
1463
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1464
+ },
1465
+ ContactId: {
1466
+ type: "string",
1467
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
1468
+ }
1469
+ }
1470
+ },
1471
+ "webhook.created": {
1472
+ type: "object",
1473
+ properties: {
1474
+ type: {
1475
+ type: "string",
1476
+ enum: ["webhook.created"]
1477
+ },
1478
+ timestamp: { type: "string" },
1479
+ data: {
1480
+ type: "object",
1481
+ properties: {
1482
+ webhookId: { $ref: "#/$defs/WebhookEndpointId" },
1483
+ organizationId: { $ref: "#/$defs/OrganizationId" },
1484
+ name: { type: "string" },
1485
+ url: { type: "string" },
1486
+ eventTypes: {
1487
+ type: "array",
1488
+ items: { type: "string" }
1489
+ },
1490
+ channels: { anyOf: [{
1491
+ type: "array",
1492
+ items: { type: "string" }
1493
+ }, { type: "null" }] },
1494
+ status: {
1495
+ type: "string",
1496
+ enum: ["active", "disabled"]
1497
+ },
1498
+ createdAt: { type: "string" },
1499
+ updatedAt: { type: "string" }
1500
+ },
1501
+ required: [
1502
+ "webhookId",
1503
+ "organizationId",
1504
+ "name",
1505
+ "url",
1506
+ "eventTypes",
1507
+ "channels",
1508
+ "status",
1509
+ "createdAt",
1510
+ "updatedAt"
1511
+ ],
1512
+ additionalProperties: true
1513
+ }
1514
+ },
1515
+ required: [
1516
+ "type",
1517
+ "timestamp",
1518
+ "data"
1519
+ ],
1520
+ additionalProperties: true,
1521
+ $defs: {
1522
+ WebhookEndpointId: {
1523
+ type: "string",
1524
+ pattern: "^wep_[0-9a-hjkmnp-tv-z]{16,24}$"
1525
+ },
1526
+ OrganizationId: {
1527
+ type: "string",
1528
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1529
+ }
1530
+ }
1531
+ },
1532
+ "webhook.updated": {
1533
+ type: "object",
1534
+ properties: {
1535
+ type: {
1536
+ type: "string",
1537
+ enum: ["webhook.updated"]
1538
+ },
1539
+ timestamp: { type: "string" },
1540
+ data: {
1541
+ type: "object",
1542
+ properties: {
1543
+ webhookId: { $ref: "#/$defs/WebhookEndpointId" },
1544
+ organizationId: { $ref: "#/$defs/OrganizationId" },
1545
+ name: { type: "string" },
1546
+ url: { type: "string" },
1547
+ eventTypes: {
1548
+ type: "array",
1549
+ items: { type: "string" }
1550
+ },
1551
+ channels: { anyOf: [{
1552
+ type: "array",
1553
+ items: { type: "string" }
1554
+ }, { type: "null" }] },
1555
+ status: {
1556
+ type: "string",
1557
+ enum: ["active", "disabled"]
1558
+ },
1559
+ createdAt: { type: "string" },
1560
+ updatedAt: { type: "string" }
1561
+ },
1562
+ required: [
1563
+ "webhookId",
1564
+ "organizationId",
1565
+ "name",
1566
+ "url",
1567
+ "eventTypes",
1568
+ "channels",
1569
+ "status",
1570
+ "createdAt",
1571
+ "updatedAt"
1572
+ ],
1573
+ additionalProperties: true
1574
+ }
1575
+ },
1576
+ required: [
1577
+ "type",
1578
+ "timestamp",
1579
+ "data"
1580
+ ],
1581
+ additionalProperties: true,
1582
+ $defs: {
1583
+ WebhookEndpointId: {
1584
+ type: "string",
1585
+ pattern: "^wep_[0-9a-hjkmnp-tv-z]{16,24}$"
1586
+ },
1587
+ OrganizationId: {
1588
+ type: "string",
1589
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1590
+ }
1591
+ }
1592
+ },
1593
+ "webhook.deleted": {
1594
+ type: "object",
1595
+ properties: {
1596
+ type: {
1597
+ type: "string",
1598
+ enum: ["webhook.deleted"]
1599
+ },
1600
+ timestamp: { type: "string" },
1601
+ data: {
1602
+ type: "object",
1603
+ properties: {
1604
+ webhookId: { $ref: "#/$defs/WebhookEndpointId" },
1605
+ organizationId: { $ref: "#/$defs/OrganizationId" },
1606
+ name: { type: "string" },
1607
+ url: { type: "string" },
1608
+ eventTypes: {
1609
+ type: "array",
1610
+ items: { type: "string" }
1611
+ },
1612
+ channels: { anyOf: [{
1613
+ type: "array",
1614
+ items: { type: "string" }
1615
+ }, { type: "null" }] },
1616
+ status: {
1617
+ type: "string",
1618
+ enum: ["active", "disabled"]
1619
+ },
1620
+ createdAt: { type: "string" },
1621
+ updatedAt: { type: "string" }
1622
+ },
1623
+ required: [
1624
+ "webhookId",
1625
+ "organizationId",
1626
+ "name",
1627
+ "url",
1628
+ "eventTypes",
1629
+ "channels",
1630
+ "status",
1631
+ "createdAt",
1632
+ "updatedAt"
1633
+ ],
1634
+ additionalProperties: true
1635
+ }
1636
+ },
1637
+ required: [
1638
+ "type",
1639
+ "timestamp",
1640
+ "data"
1641
+ ],
1642
+ additionalProperties: true,
1643
+ $defs: {
1644
+ WebhookEndpointId: {
1645
+ type: "string",
1646
+ pattern: "^wep_[0-9a-hjkmnp-tv-z]{16,24}$"
1647
+ },
1648
+ OrganizationId: {
1649
+ type: "string",
1650
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1651
+ }
1652
+ }
1653
+ },
1654
+ "webhook.test": {
1655
+ type: "object",
1656
+ properties: {
1657
+ type: {
1658
+ type: "string",
1659
+ enum: ["webhook.test"]
1660
+ },
1661
+ timestamp: { type: "string" },
1662
+ data: { type: "object" }
1663
+ },
1664
+ required: [
1665
+ "type",
1666
+ "timestamp",
1667
+ "data"
1668
+ ],
1669
+ additionalProperties: true,
1670
+ $defs: {}
1671
+ },
1672
+ "domain.updated": {
1673
+ type: "object",
1674
+ properties: {
1675
+ type: {
1676
+ type: "string",
1677
+ enum: ["domain.updated"]
1678
+ },
1679
+ timestamp: { type: "string" },
1680
+ data: {
1681
+ type: "object",
1682
+ properties: {
1683
+ domainId: { $ref: "#/$defs/EmailDomainId" },
1684
+ organizationId: { $ref: "#/$defs/OrganizationId" },
1685
+ domain: { type: "string" },
1686
+ previousPhase: {
1687
+ type: "string",
1688
+ enum: [
1689
+ "dns-setup",
1690
+ "provisioning",
1691
+ "verifying",
1692
+ "ready",
1693
+ "degraded",
1694
+ "failed"
1695
+ ]
1696
+ },
1697
+ phase: {
1698
+ type: "string",
1699
+ enum: [
1700
+ "dns-setup",
1701
+ "provisioning",
1702
+ "verifying",
1703
+ "ready",
1704
+ "degraded",
1705
+ "failed"
1706
+ ]
1707
+ },
1708
+ dns: {
1709
+ type: "object",
1710
+ properties: {
1711
+ observed: { type: "boolean" },
1712
+ total: { type: "integer" },
1713
+ satisfied: { type: "integer" },
1714
+ missing: { type: "integer" },
1715
+ mismatch: { type: "integer" },
1716
+ unknown: { type: "integer" }
1717
+ },
1718
+ required: [
1719
+ "observed",
1720
+ "total",
1721
+ "satisfied",
1722
+ "missing",
1723
+ "mismatch",
1724
+ "unknown"
1725
+ ],
1726
+ additionalProperties: true
1727
+ },
1728
+ provider: { anyOf: [{
1729
+ type: "object",
1730
+ properties: {
1731
+ identity: {
1732
+ type: "string",
1733
+ enum: [
1734
+ "pending",
1735
+ "verified",
1736
+ "failed",
1737
+ "unknown"
1738
+ ]
1739
+ },
1740
+ dkim: { anyOf: [{
1741
+ type: "string",
1742
+ enum: [
1743
+ "pending",
1744
+ "verified",
1745
+ "failed",
1746
+ "unknown"
1747
+ ]
1748
+ }, { type: "null" }] },
1749
+ mailFrom: { anyOf: [{
1750
+ type: "string",
1751
+ enum: [
1752
+ "pending",
1753
+ "verified",
1754
+ "failed",
1755
+ "unknown"
1756
+ ]
1757
+ }, { type: "null" }] }
1758
+ },
1759
+ required: ["identity"],
1760
+ additionalProperties: true
1761
+ }, { type: "null" }] },
1762
+ operationId: { anyOf: [{ $ref: "#/$defs/OperationId" }, { type: "null" }] },
1763
+ checkedAt: { anyOf: [{ type: "string" }, { type: "null" }] },
1764
+ nextCheckAt: { anyOf: [{ type: "string" }, { type: "null" }] },
1765
+ failure: { anyOf: [{
1766
+ type: "object",
1767
+ properties: {
1768
+ code: { type: "string" },
1769
+ message: { type: "string" },
1770
+ failedAt: { type: "string" }
1771
+ },
1772
+ required: [
1773
+ "code",
1774
+ "message",
1775
+ "failedAt"
1776
+ ],
1777
+ additionalProperties: true
1778
+ }, { type: "null" }] },
1779
+ updatedAt: { type: "string" }
1780
+ },
1781
+ required: [
1782
+ "domainId",
1783
+ "organizationId",
1784
+ "domain",
1785
+ "previousPhase",
1786
+ "phase",
1787
+ "dns",
1788
+ "provider",
1789
+ "operationId",
1790
+ "checkedAt",
1791
+ "nextCheckAt",
1792
+ "failure",
1793
+ "updatedAt"
1794
+ ],
1795
+ additionalProperties: true
1796
+ }
1797
+ },
1798
+ required: [
1799
+ "type",
1800
+ "timestamp",
1801
+ "data"
1802
+ ],
1803
+ additionalProperties: true,
1804
+ $defs: {
1805
+ EmailDomainId: {
1806
+ type: "string",
1807
+ pattern: "^dom_[0-9a-hjkmnp-tv-z]{16,24}$"
1808
+ },
1809
+ OrganizationId: {
1810
+ type: "string",
1811
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1812
+ },
1813
+ OperationId: {
1814
+ type: "string",
1815
+ pattern: "^op_[0-9a-hjkmnp-tv-z]{16,24}$"
1816
+ }
1817
+ }
1818
+ },
1819
+ "domain.warming.updated": {
1820
+ type: "object",
1821
+ properties: {
1822
+ type: {
1823
+ type: "string",
1824
+ enum: ["domain.warming.updated"]
1825
+ },
1826
+ timestamp: { type: "string" },
1827
+ data: {
1828
+ type: "object",
1829
+ properties: {
1830
+ domainId: { type: "string" },
1831
+ organizationId: { type: "string" },
1832
+ domain: { type: "string" },
1833
+ planId: { type: "string" },
1834
+ reason: {
1835
+ type: "string",
1836
+ enum: [
1837
+ "plan-created",
1838
+ "policy-updated",
1839
+ "window-opened",
1840
+ "window-cancelled",
1841
+ "paused",
1842
+ "resumed",
1843
+ "held",
1844
+ "completed"
1845
+ ]
1846
+ },
1847
+ status: {
1848
+ type: "string",
1849
+ enum: [
1850
+ "active",
1851
+ "paused",
1852
+ "completed"
1853
+ ]
1854
+ },
1855
+ holdReason: { anyOf: [{ type: "string" }, { type: "null" }] },
1856
+ batch: { anyOf: [{
1857
+ type: "object",
1858
+ properties: {
1859
+ id: { type: "string" },
1860
+ sequence: { type: "number" },
1861
+ startsAt: { type: "string" },
1862
+ endsAt: { type: "string" },
1863
+ allowanceRecipients: { type: "number" },
1864
+ dailyGrowthPercent: { type: "number" },
1865
+ targetDailyRecipients: { type: "number" }
1866
+ },
1867
+ required: [
1868
+ "id",
1869
+ "sequence",
1870
+ "startsAt",
1871
+ "endsAt",
1872
+ "allowanceRecipients",
1873
+ "dailyGrowthPercent",
1874
+ "targetDailyRecipients"
1875
+ ],
1876
+ additionalProperties: true
1877
+ }, { type: "null" }] },
1878
+ updatedAt: { type: "string" }
1879
+ },
1880
+ required: [
1881
+ "domainId",
1882
+ "organizationId",
1883
+ "domain",
1884
+ "planId",
1885
+ "reason",
1886
+ "status",
1887
+ "holdReason",
1888
+ "batch",
1889
+ "updatedAt"
1890
+ ],
1891
+ additionalProperties: true
1892
+ }
1893
+ },
1894
+ required: [
1895
+ "type",
1896
+ "timestamp",
1897
+ "data"
1898
+ ],
1899
+ additionalProperties: true,
1900
+ $defs: {}
1901
+ },
1902
+ "mailbox.message.received": {
1903
+ type: "object",
1904
+ properties: {
1905
+ type: {
1906
+ type: "string",
1907
+ enum: ["mailbox.message.received"]
1908
+ },
1909
+ timestamp: { type: "string" },
1910
+ data: {
1911
+ type: "object",
1912
+ properties: {
1913
+ mailboxId: { $ref: "#/$defs/MailboxId" },
1914
+ namespaceId: { anyOf: [{ $ref: "#/$defs/NamespaceId" }, { type: "null" }] },
1915
+ message: {
1916
+ type: "object",
1917
+ properties: {
1918
+ id: { $ref: "#/$defs/MessageId" },
1919
+ threadId: { $ref: "#/$defs/MailboxThreadId" },
1920
+ from: {
1921
+ type: "object",
1922
+ properties: {
1923
+ address: { type: "string" },
1924
+ name: { anyOf: [{ type: "string" }, { type: "null" }] }
1925
+ },
1926
+ required: ["address"],
1927
+ additionalProperties: true
1928
+ },
1929
+ to: {
1930
+ type: "array",
1931
+ items: { type: "string" }
1932
+ },
1933
+ cc: {
1934
+ type: "array",
1935
+ items: { type: "string" }
1936
+ },
1937
+ subject: { anyOf: [{ type: "string" }, { type: "null" }] },
1938
+ text: { anyOf: [{ type: "string" }, { type: "null" }] },
1939
+ replyText: { anyOf: [{ type: "string" }, { type: "null" }] },
1940
+ attachments: {
1941
+ type: "array",
1942
+ items: {
1943
+ type: "object",
1944
+ properties: {
1945
+ id: { $ref: "#/$defs/AttachmentId" },
1946
+ filename: { type: "string" },
1947
+ contentType: { type: "string" },
1948
+ size: { type: "number" }
1949
+ },
1950
+ required: [
1951
+ "id",
1952
+ "filename",
1953
+ "contentType",
1954
+ "size"
1955
+ ],
1956
+ additionalProperties: true
1957
+ }
1958
+ },
1959
+ occurredAt: { type: "string" }
1960
+ },
1961
+ required: [
1962
+ "id",
1963
+ "threadId",
1964
+ "from",
1965
+ "to",
1966
+ "cc",
1967
+ "subject",
1968
+ "text",
1969
+ "replyText",
1970
+ "attachments",
1971
+ "occurredAt"
1972
+ ],
1973
+ additionalProperties: true
1974
+ },
1975
+ thread: {
1976
+ type: "object",
1977
+ properties: {
1978
+ id: { $ref: "#/$defs/MailboxThreadId" },
1979
+ subject: { anyOf: [{ type: "string" }, { type: "null" }] },
1980
+ preview: { anyOf: [{ type: "string" }, { type: "null" }] }
1981
+ },
1982
+ required: [
1983
+ "id",
1984
+ "subject",
1985
+ "preview"
1986
+ ],
1987
+ additionalProperties: true
1988
+ }
1989
+ },
1990
+ required: [
1991
+ "mailboxId",
1992
+ "namespaceId",
1993
+ "message",
1994
+ "thread"
1995
+ ],
1996
+ additionalProperties: true
1997
+ }
1998
+ },
1999
+ required: [
2000
+ "type",
2001
+ "timestamp",
2002
+ "data"
2003
+ ],
2004
+ additionalProperties: true,
2005
+ $defs: {
2006
+ MailboxId: {
2007
+ type: "string",
2008
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
2009
+ },
2010
+ NamespaceId: {
2011
+ type: "string",
2012
+ pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
2013
+ },
2014
+ MessageId: {
2015
+ type: "string",
2016
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
2017
+ },
2018
+ MailboxThreadId: {
2019
+ type: "string",
2020
+ pattern: "^thread_[0-9a-hjkmnp-tv-z]{16,24}$"
2021
+ },
2022
+ AttachmentId: {
2023
+ type: "string",
2024
+ pattern: "^att_[0-9a-hjkmnp-tv-z]{16,24}$"
2025
+ }
2026
+ }
2027
+ },
2028
+ "mailbox.message.sent": {
2029
+ type: "object",
2030
+ properties: {
2031
+ type: {
2032
+ type: "string",
2033
+ enum: ["mailbox.message.sent"]
2034
+ },
2035
+ timestamp: { type: "string" },
2036
+ data: {
2037
+ type: "object",
2038
+ properties: {
2039
+ mailboxId: { $ref: "#/$defs/MailboxId" },
2040
+ namespaceId: { anyOf: [{ $ref: "#/$defs/NamespaceId" }, { type: "null" }] },
2041
+ actionId: { $ref: "#/$defs/MailboxActionId" },
2042
+ state: {
2043
+ type: "string",
2044
+ enum: ["completed"],
2045
+ description: "Deliveries recorded before this field existed omit it."
2046
+ },
2047
+ acceptedAt: { type: "string" },
2048
+ actor: {
2049
+ type: "object",
2050
+ properties: {
2051
+ kind: {
2052
+ type: "string",
2053
+ enum: [
2054
+ "user",
2055
+ "apiKey",
2056
+ "extension",
2057
+ "externalAgent",
2058
+ "samvaAgent",
2059
+ "system"
2060
+ ]
2061
+ },
2062
+ id: { type: "string" },
2063
+ displayName: { anyOf: [{ type: "string" }, { type: "null" }] },
2064
+ source: {
2065
+ type: "string",
2066
+ enum: [
2067
+ "humanUi",
2068
+ "externalApi",
2069
+ "externalAgent",
2070
+ "extension",
2071
+ "system"
2072
+ ]
2073
+ }
2074
+ },
2075
+ required: [
2076
+ "kind",
2077
+ "id",
2078
+ "source"
2079
+ ],
2080
+ additionalProperties: true
2081
+ },
2082
+ message: {
2083
+ type: "object",
2084
+ properties: {
2085
+ id: { $ref: "#/$defs/MessageId" },
2086
+ threadId: { $ref: "#/$defs/MailboxThreadId" },
2087
+ from: {
2088
+ type: "object",
2089
+ properties: {
2090
+ address: { type: "string" },
2091
+ name: { anyOf: [{ type: "string" }, { type: "null" }] }
2092
+ },
2093
+ required: ["address"],
2094
+ additionalProperties: true
2095
+ },
2096
+ to: {
2097
+ type: "array",
2098
+ items: { type: "string" }
2099
+ },
2100
+ cc: {
2101
+ type: "array",
2102
+ items: { type: "string" }
2103
+ },
2104
+ subject: { anyOf: [{ type: "string" }, { type: "null" }] },
2105
+ text: { anyOf: [{ type: "string" }, { type: "null" }] },
2106
+ replyText: { anyOf: [{ type: "string" }, { type: "null" }] },
2107
+ attachments: {
2108
+ type: "array",
2109
+ items: {
2110
+ type: "object",
2111
+ properties: {
2112
+ id: { $ref: "#/$defs/AttachmentId" },
2113
+ filename: { type: "string" },
2114
+ contentType: { type: "string" },
2115
+ size: { type: "number" }
2116
+ },
2117
+ required: [
2118
+ "id",
2119
+ "filename",
2120
+ "contentType",
2121
+ "size"
2122
+ ],
2123
+ additionalProperties: true
2124
+ }
2125
+ },
2126
+ occurredAt: { type: "string" }
2127
+ },
2128
+ required: [
2129
+ "id",
2130
+ "threadId",
2131
+ "from",
2132
+ "to",
2133
+ "cc",
2134
+ "subject",
2135
+ "text",
2136
+ "replyText",
2137
+ "attachments",
2138
+ "occurredAt"
2139
+ ],
2140
+ additionalProperties: true
2141
+ }
2142
+ },
2143
+ required: [
2144
+ "mailboxId",
2145
+ "namespaceId",
2146
+ "actionId",
2147
+ "actor",
2148
+ "message"
2149
+ ],
2150
+ additionalProperties: true
2151
+ }
2152
+ },
2153
+ required: [
2154
+ "type",
2155
+ "timestamp",
2156
+ "data"
2157
+ ],
2158
+ additionalProperties: true,
2159
+ $defs: {
2160
+ MailboxId: {
2161
+ type: "string",
2162
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
2163
+ },
2164
+ NamespaceId: {
2165
+ type: "string",
2166
+ pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
2167
+ },
2168
+ MailboxActionId: {
2169
+ type: "string",
2170
+ pattern: "^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$"
2171
+ },
2172
+ MessageId: {
2173
+ type: "string",
2174
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
2175
+ },
2176
+ MailboxThreadId: {
2177
+ type: "string",
2178
+ pattern: "^thread_[0-9a-hjkmnp-tv-z]{16,24}$"
2179
+ },
2180
+ AttachmentId: {
2181
+ type: "string",
2182
+ pattern: "^att_[0-9a-hjkmnp-tv-z]{16,24}$"
2183
+ }
2184
+ }
2185
+ },
2186
+ "mailbox.action.pending_approval": {
2187
+ type: "object",
2188
+ properties: {
2189
+ type: {
2190
+ type: "string",
2191
+ enum: ["mailbox.action.pending_approval"]
2192
+ },
2193
+ timestamp: { type: "string" },
2194
+ data: {
2195
+ type: "object",
2196
+ properties: {
2197
+ mailboxId: { $ref: "#/$defs/MailboxId" },
2198
+ namespaceId: { anyOf: [{ $ref: "#/$defs/NamespaceId" }, { type: "null" }] },
2199
+ action: {
2200
+ type: "object",
2201
+ properties: {
2202
+ id: { $ref: "#/$defs/MailboxActionId" },
2203
+ type: {
2204
+ type: "string",
2205
+ enum: [
2206
+ "sendMessage",
2207
+ "reply",
2208
+ "updateDraft",
2209
+ "createNote",
2210
+ "assignThread",
2211
+ "changeThreadState",
2212
+ "call",
2213
+ "extensionRequest"
2214
+ ]
2215
+ },
2216
+ state: {
2217
+ type: "string",
2218
+ enum: ["approvalRequired"],
2219
+ description: "Deliveries recorded before this field existed omit it."
2220
+ },
2221
+ decision: { $ref: "#/$defs/MailboxActionDecision" },
2222
+ threadId: { anyOf: [{ $ref: "#/$defs/MailboxThreadId" }, { type: "null" }] },
2223
+ reason: { anyOf: [{ type: "string" }, { type: "null" }] },
2224
+ proposedBy: {
2225
+ type: "object",
2226
+ properties: {
2227
+ kind: {
2228
+ type: "string",
2229
+ enum: [
2230
+ "user",
2231
+ "apiKey",
2232
+ "extension",
2233
+ "externalAgent",
2234
+ "samvaAgent",
2235
+ "system"
2236
+ ]
2237
+ },
2238
+ id: { type: "string" },
2239
+ displayName: { anyOf: [{ type: "string" }, { type: "null" }] },
2240
+ source: {
2241
+ type: "string",
2242
+ enum: [
2243
+ "humanUi",
2244
+ "externalApi",
2245
+ "externalAgent",
2246
+ "extension",
2247
+ "system"
2248
+ ]
2249
+ }
2250
+ },
2251
+ required: [
2252
+ "kind",
2253
+ "id",
2254
+ "source"
2255
+ ],
2256
+ additionalProperties: true
2257
+ },
2258
+ createdAt: { type: "string" }
2259
+ },
2260
+ required: [
2261
+ "id",
2262
+ "type",
2263
+ "threadId",
2264
+ "reason",
2265
+ "proposedBy",
2266
+ "createdAt"
2267
+ ],
2268
+ additionalProperties: true
2269
+ },
2270
+ draft: {
2271
+ type: "object",
2272
+ properties: {
2273
+ to: {
2274
+ type: "array",
2275
+ items: { type: "string" }
2276
+ },
2277
+ cc: {
2278
+ type: "array",
2279
+ items: { type: "string" }
2280
+ },
2281
+ subject: { anyOf: [{ type: "string" }, { type: "null" }] }
2282
+ },
2283
+ required: [
2284
+ "to",
2285
+ "cc",
2286
+ "subject"
2287
+ ],
2288
+ additionalProperties: true
2289
+ }
2290
+ },
2291
+ required: [
2292
+ "mailboxId",
2293
+ "namespaceId",
2294
+ "action",
2295
+ "draft"
2296
+ ],
2297
+ additionalProperties: true
2298
+ }
2299
+ },
2300
+ required: [
2301
+ "type",
2302
+ "timestamp",
2303
+ "data"
2304
+ ],
2305
+ additionalProperties: true,
2306
+ $defs: {
2307
+ MailboxId: {
2308
+ type: "string",
2309
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
2310
+ },
2311
+ NamespaceId: {
2312
+ type: "string",
2313
+ pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
2314
+ },
2315
+ MailboxActionId: {
2316
+ type: "string",
2317
+ pattern: "^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$"
2318
+ },
2319
+ MailboxPolicyId: {
2320
+ type: "string",
2321
+ pattern: "^mbxpol_[0-9a-hjkmnp-tv-z]{16,24}$"
2322
+ },
2323
+ MailboxActionDecision: {
2324
+ type: "object",
2325
+ properties: {
2326
+ outcome: {
2327
+ type: "string",
2328
+ enum: [
2329
+ "allow",
2330
+ "requireApproval",
2331
+ "deny"
2332
+ ]
2333
+ },
2334
+ reason: { anyOf: [{ type: "string" }, { type: "null" }] },
2335
+ policyId: { anyOf: [{ $ref: "#/$defs/MailboxPolicyId" }, { type: "null" }] },
2336
+ source: { anyOf: [{
2337
+ type: "string",
2338
+ enum: [
2339
+ "grant",
2340
+ "installation",
2341
+ "policy"
2342
+ ]
2343
+ }, { type: "null" }] },
2344
+ decidedAt: { type: "string" }
2345
+ },
2346
+ required: [
2347
+ "outcome",
2348
+ "reason",
2349
+ "policyId",
2350
+ "source",
2351
+ "decidedAt"
2352
+ ],
2353
+ additionalProperties: true,
2354
+ description: "Deliveries recorded before this field existed omit it."
2355
+ },
2356
+ MailboxThreadId: {
2357
+ type: "string",
2358
+ pattern: "^thread_[0-9a-hjkmnp-tv-z]{16,24}$"
2359
+ }
2360
+ }
2361
+ },
2362
+ "mailbox.message.quarantined": {
2363
+ type: "object",
2364
+ properties: {
2365
+ type: {
2366
+ type: "string",
2367
+ enum: ["mailbox.message.quarantined"]
2368
+ },
2369
+ timestamp: { type: "string" },
2370
+ data: {
2371
+ type: "object",
2372
+ properties: {
2373
+ mailboxId: { $ref: "#/$defs/MailboxId" },
2374
+ namespaceId: { anyOf: [{ $ref: "#/$defs/NamespaceId" }, { type: "null" }] },
2375
+ disposition: {
2376
+ type: "string",
2377
+ enum: ["quarantined", "isolated"]
2378
+ },
2379
+ reason: {
2380
+ type: "string",
2381
+ enum: [
2382
+ "spam",
2383
+ "dmarc",
2384
+ "virus",
2385
+ "virus_unscanned",
2386
+ "phishing",
2387
+ "fraud",
2388
+ "prompt_injection"
2389
+ ]
2390
+ },
2391
+ source: {
2392
+ type: "string",
2393
+ enum: ["receipt", "classifier"]
2394
+ },
2395
+ message: {
2396
+ type: "object",
2397
+ properties: {
2398
+ id: { $ref: "#/$defs/MessageId" },
2399
+ from: {
2400
+ type: "object",
2401
+ properties: {
2402
+ address: { type: "string" },
2403
+ name: { anyOf: [{ type: "string" }, { type: "null" }] }
2404
+ },
2405
+ required: ["address"],
2406
+ additionalProperties: true
2407
+ },
2408
+ subject: { anyOf: [{ type: "string" }, { type: "null" }] },
2409
+ receivedAt: { type: "string" }
2410
+ },
2411
+ required: [
2412
+ "id",
2413
+ "from",
2414
+ "subject",
2415
+ "receivedAt"
2416
+ ],
2417
+ additionalProperties: true
2418
+ }
2419
+ },
2420
+ required: [
2421
+ "mailboxId",
2422
+ "namespaceId",
2423
+ "disposition",
2424
+ "reason",
2425
+ "source",
2426
+ "message"
2427
+ ],
2428
+ additionalProperties: true
2429
+ }
2430
+ },
2431
+ required: [
2432
+ "type",
2433
+ "timestamp",
2434
+ "data"
2435
+ ],
2436
+ additionalProperties: true,
2437
+ $defs: {
2438
+ MailboxId: {
2439
+ type: "string",
2440
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
2441
+ },
2442
+ NamespaceId: {
2443
+ type: "string",
2444
+ pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
2445
+ },
2446
+ MessageId: {
2447
+ type: "string",
2448
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
2449
+ }
2450
+ }
2451
+ },
2452
+ "mailbox.message.released": {
2453
+ type: "object",
2454
+ properties: {
2455
+ type: {
2456
+ type: "string",
2457
+ enum: ["mailbox.message.released"]
2458
+ },
2459
+ timestamp: { type: "string" },
2460
+ data: {
2461
+ type: "object",
2462
+ properties: {
2463
+ mailboxId: { $ref: "#/$defs/MailboxId" },
2464
+ namespaceId: { anyOf: [{ $ref: "#/$defs/NamespaceId" }, { type: "null" }] },
2465
+ releasedBy: {
2466
+ type: "object",
2467
+ properties: {
2468
+ kind: {
2469
+ type: "string",
2470
+ enum: [
2471
+ "user",
2472
+ "apiKey",
2473
+ "extension",
2474
+ "externalAgent",
2475
+ "samvaAgent",
2476
+ "system"
2477
+ ]
2478
+ },
2479
+ id: { type: "string" },
2480
+ displayName: { anyOf: [{ type: "string" }, { type: "null" }] },
2481
+ source: {
2482
+ type: "string",
2483
+ enum: [
2484
+ "humanUi",
2485
+ "externalApi",
2486
+ "externalAgent",
2487
+ "extension",
2488
+ "system"
2489
+ ]
2490
+ }
2491
+ },
2492
+ required: [
2493
+ "kind",
2494
+ "id",
2495
+ "source"
2496
+ ],
2497
+ additionalProperties: true
2498
+ },
2499
+ reason: {
2500
+ type: "string",
2501
+ enum: [
2502
+ "spam",
2503
+ "dmarc",
2504
+ "virus",
2505
+ "virus_unscanned",
2506
+ "phishing",
2507
+ "fraud",
2508
+ "prompt_injection"
2509
+ ]
2510
+ },
2511
+ message: {
2512
+ type: "object",
2513
+ properties: {
2514
+ id: { $ref: "#/$defs/MessageId" },
2515
+ threadId: { $ref: "#/$defs/MailboxThreadId" },
2516
+ from: {
2517
+ type: "object",
2518
+ properties: {
2519
+ address: { type: "string" },
2520
+ name: { anyOf: [{ type: "string" }, { type: "null" }] }
2521
+ },
2522
+ required: ["address"],
2523
+ additionalProperties: true
2524
+ },
2525
+ to: {
2526
+ type: "array",
2527
+ items: { type: "string" }
2528
+ },
2529
+ cc: {
2530
+ type: "array",
2531
+ items: { type: "string" }
2532
+ },
2533
+ subject: { anyOf: [{ type: "string" }, { type: "null" }] },
2534
+ text: { anyOf: [{ type: "string" }, { type: "null" }] },
2535
+ replyText: { anyOf: [{ type: "string" }, { type: "null" }] },
2536
+ attachments: {
2537
+ type: "array",
2538
+ items: {
2539
+ type: "object",
2540
+ properties: {
2541
+ id: { $ref: "#/$defs/AttachmentId" },
2542
+ filename: { type: "string" },
2543
+ contentType: { type: "string" },
2544
+ size: { type: "number" }
2545
+ },
2546
+ required: [
2547
+ "id",
2548
+ "filename",
2549
+ "contentType",
2550
+ "size"
2551
+ ],
2552
+ additionalProperties: true
2553
+ }
2554
+ },
2555
+ occurredAt: { type: "string" }
2556
+ },
2557
+ required: [
2558
+ "id",
2559
+ "threadId",
2560
+ "from",
2561
+ "to",
2562
+ "cc",
2563
+ "subject",
2564
+ "text",
2565
+ "replyText",
2566
+ "attachments",
2567
+ "occurredAt"
2568
+ ],
2569
+ additionalProperties: true
2570
+ },
2571
+ thread: {
2572
+ type: "object",
2573
+ properties: {
2574
+ id: { $ref: "#/$defs/MailboxThreadId" },
2575
+ subject: { anyOf: [{ type: "string" }, { type: "null" }] },
2576
+ preview: { anyOf: [{ type: "string" }, { type: "null" }] }
2577
+ },
2578
+ required: [
2579
+ "id",
2580
+ "subject",
2581
+ "preview"
2582
+ ],
2583
+ additionalProperties: true
2584
+ }
2585
+ },
2586
+ required: [
2587
+ "mailboxId",
2588
+ "namespaceId",
2589
+ "releasedBy",
2590
+ "reason",
2591
+ "message",
2592
+ "thread"
2593
+ ],
2594
+ additionalProperties: true
2595
+ }
2596
+ },
2597
+ required: [
2598
+ "type",
2599
+ "timestamp",
2600
+ "data"
2601
+ ],
2602
+ additionalProperties: true,
2603
+ $defs: {
2604
+ MailboxId: {
2605
+ type: "string",
2606
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
2607
+ },
2608
+ NamespaceId: {
2609
+ type: "string",
2610
+ pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
2611
+ },
2612
+ MessageId: {
2613
+ type: "string",
2614
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
2615
+ },
2616
+ MailboxThreadId: {
2617
+ type: "string",
2618
+ pattern: "^thread_[0-9a-hjkmnp-tv-z]{16,24}$"
2619
+ },
2620
+ AttachmentId: {
2621
+ type: "string",
2622
+ pattern: "^att_[0-9a-hjkmnp-tv-z]{16,24}$"
2623
+ }
2624
+ }
2625
+ },
2626
+ "mailbox.message.discarded": {
2627
+ type: "object",
2628
+ properties: {
2629
+ type: {
2630
+ type: "string",
2631
+ enum: ["mailbox.message.discarded"]
2632
+ },
2633
+ timestamp: { type: "string" },
2634
+ data: {
2635
+ type: "object",
2636
+ properties: {
2637
+ mailboxId: { $ref: "#/$defs/MailboxId" },
2638
+ namespaceId: { anyOf: [{ $ref: "#/$defs/NamespaceId" }, { type: "null" }] },
2639
+ discardedBy: {
2640
+ type: "object",
2641
+ properties: {
2642
+ kind: {
2643
+ type: "string",
2644
+ enum: [
2645
+ "user",
2646
+ "apiKey",
2647
+ "extension",
2648
+ "externalAgent",
2649
+ "samvaAgent",
2650
+ "system"
2651
+ ]
2652
+ },
2653
+ id: { type: "string" },
2654
+ displayName: { anyOf: [{ type: "string" }, { type: "null" }] },
2655
+ source: {
2656
+ type: "string",
2657
+ enum: [
2658
+ "humanUi",
2659
+ "externalApi",
2660
+ "externalAgent",
2661
+ "extension",
2662
+ "system"
2663
+ ]
2664
+ }
2665
+ },
2666
+ required: [
2667
+ "kind",
2668
+ "id",
2669
+ "source"
2670
+ ],
2671
+ additionalProperties: true
2672
+ },
2673
+ disposition: {
2674
+ type: "string",
2675
+ enum: ["quarantined", "isolated"]
2676
+ },
2677
+ reason: {
2678
+ type: "string",
2679
+ enum: [
2680
+ "spam",
2681
+ "dmarc",
2682
+ "virus",
2683
+ "virus_unscanned",
2684
+ "phishing",
2685
+ "fraud",
2686
+ "prompt_injection"
2687
+ ]
2688
+ },
2689
+ message: {
2690
+ type: "object",
2691
+ properties: {
2692
+ id: { $ref: "#/$defs/MessageId" },
2693
+ from: {
2694
+ type: "object",
2695
+ properties: {
2696
+ address: { type: "string" },
2697
+ name: { anyOf: [{ type: "string" }, { type: "null" }] }
2698
+ },
2699
+ required: ["address"],
2700
+ additionalProperties: true
2701
+ },
2702
+ subject: { anyOf: [{ type: "string" }, { type: "null" }] },
2703
+ receivedAt: { type: "string" }
2704
+ },
2705
+ required: [
2706
+ "id",
2707
+ "from",
2708
+ "subject",
2709
+ "receivedAt"
2710
+ ],
2711
+ additionalProperties: true
2712
+ }
2713
+ },
2714
+ required: [
2715
+ "mailboxId",
2716
+ "namespaceId",
2717
+ "discardedBy",
2718
+ "disposition",
2719
+ "reason",
2720
+ "message"
2721
+ ],
2722
+ additionalProperties: true
2723
+ }
2724
+ },
2725
+ required: [
2726
+ "type",
2727
+ "timestamp",
2728
+ "data"
2729
+ ],
2730
+ additionalProperties: true,
2731
+ $defs: {
2732
+ MailboxId: {
2733
+ type: "string",
2734
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
2735
+ },
2736
+ NamespaceId: {
2737
+ type: "string",
2738
+ pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
2739
+ },
2740
+ MessageId: {
2741
+ type: "string",
2742
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
2743
+ }
2744
+ }
2745
+ }
2746
+ };
2747
+ //#endregion
2748
+ export { WebhookEventJsonSchemas as t };
2749
+
2750
+ //# sourceMappingURL=json-schemas.gen-eya_ZDps.js.map