@samva/webhooks 0.20.0 → 0.22.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.
@@ -11,7 +11,10 @@ const WebhookEventJsonSchemas = {
11
11
  data: {
12
12
  type: "object",
13
13
  properties: {
14
- mailboxId: { anyOf: [{ $ref: "#/$defs/MailboxId" }, { type: "null" }] },
14
+ mailboxId: { anyOf: [{
15
+ type: "string",
16
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
17
+ }, { type: "null" }] },
15
18
  channel: {
16
19
  type: "string",
17
20
  enum: [
@@ -74,11 +77,7 @@ const WebhookEventJsonSchemas = {
74
77
  "timestamp",
75
78
  "data"
76
79
  ],
77
- additionalProperties: true,
78
- $defs: { MailboxId: {
79
- type: "string",
80
- pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
81
- } }
80
+ additionalProperties: true
82
81
  },
83
82
  "message.delivered": {
84
83
  type: "object",
@@ -91,7 +90,10 @@ const WebhookEventJsonSchemas = {
91
90
  data: {
92
91
  type: "object",
93
92
  properties: {
94
- mailboxId: { anyOf: [{ $ref: "#/$defs/MailboxId" }, { type: "null" }] },
93
+ mailboxId: { anyOf: [{
94
+ type: "string",
95
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
96
+ }, { type: "null" }] },
95
97
  channel: {
96
98
  type: "string",
97
99
  enum: [
@@ -154,11 +156,7 @@ const WebhookEventJsonSchemas = {
154
156
  "timestamp",
155
157
  "data"
156
158
  ],
157
- additionalProperties: true,
158
- $defs: { MailboxId: {
159
- type: "string",
160
- pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
161
- } }
159
+ additionalProperties: true
162
160
  },
163
161
  "message.read": {
164
162
  type: "object",
@@ -171,7 +169,10 @@ const WebhookEventJsonSchemas = {
171
169
  data: {
172
170
  type: "object",
173
171
  properties: {
174
- mailboxId: { anyOf: [{ $ref: "#/$defs/MailboxId" }, { type: "null" }] },
172
+ mailboxId: { anyOf: [{
173
+ type: "string",
174
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
175
+ }, { type: "null" }] },
175
176
  channel: {
176
177
  type: "string",
177
178
  enum: [
@@ -234,11 +235,7 @@ const WebhookEventJsonSchemas = {
234
235
  "timestamp",
235
236
  "data"
236
237
  ],
237
- additionalProperties: true,
238
- $defs: { MailboxId: {
239
- type: "string",
240
- pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
241
- } }
238
+ additionalProperties: true
242
239
  },
243
240
  "message.failed": {
244
241
  type: "object",
@@ -251,7 +248,10 @@ const WebhookEventJsonSchemas = {
251
248
  data: {
252
249
  type: "object",
253
250
  properties: {
254
- mailboxId: { anyOf: [{ $ref: "#/$defs/MailboxId" }, { type: "null" }] },
251
+ mailboxId: { anyOf: [{
252
+ type: "string",
253
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
254
+ }, { type: "null" }] },
255
255
  channel: {
256
256
  type: "string",
257
257
  enum: [
@@ -314,11 +314,7 @@ const WebhookEventJsonSchemas = {
314
314
  "timestamp",
315
315
  "data"
316
316
  ],
317
- additionalProperties: true,
318
- $defs: { MailboxId: {
319
- type: "string",
320
- pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
321
- } }
317
+ additionalProperties: true
322
318
  },
323
319
  "message.bounced": {
324
320
  type: "object",
@@ -331,7 +327,10 @@ const WebhookEventJsonSchemas = {
331
327
  data: {
332
328
  type: "object",
333
329
  properties: {
334
- mailboxId: { anyOf: [{ $ref: "#/$defs/MailboxId" }, { type: "null" }] },
330
+ mailboxId: { anyOf: [{
331
+ type: "string",
332
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
333
+ }, { type: "null" }] },
335
334
  channel: {
336
335
  type: "string",
337
336
  enum: [
@@ -396,11 +395,7 @@ const WebhookEventJsonSchemas = {
396
395
  "timestamp",
397
396
  "data"
398
397
  ],
399
- additionalProperties: true,
400
- $defs: { MailboxId: {
401
- type: "string",
402
- pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
403
- } }
398
+ additionalProperties: true
404
399
  },
405
400
  "message.complained": {
406
401
  type: "object",
@@ -413,7 +408,10 @@ const WebhookEventJsonSchemas = {
413
408
  data: {
414
409
  type: "object",
415
410
  properties: {
416
- mailboxId: { anyOf: [{ $ref: "#/$defs/MailboxId" }, { type: "null" }] },
411
+ mailboxId: { anyOf: [{
412
+ type: "string",
413
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
414
+ }, { type: "null" }] },
417
415
  channel: {
418
416
  type: "string",
419
417
  enum: [
@@ -478,11 +476,7 @@ const WebhookEventJsonSchemas = {
478
476
  "timestamp",
479
477
  "data"
480
478
  ],
481
- additionalProperties: true,
482
- $defs: { MailboxId: {
483
- type: "string",
484
- pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
485
- } }
479
+ additionalProperties: true
486
480
  },
487
481
  "message.received": {
488
482
  type: "object",
@@ -495,7 +489,10 @@ const WebhookEventJsonSchemas = {
495
489
  data: {
496
490
  type: "object",
497
491
  properties: {
498
- mailboxId: { anyOf: [{ $ref: "#/$defs/MailboxId" }, { type: "null" }] },
492
+ mailboxId: { anyOf: [{
493
+ type: "string",
494
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
495
+ }, { type: "null" }] },
499
496
  channel: {
500
497
  type: "string",
501
498
  enum: [
@@ -542,713 +539,819 @@ const WebhookEventJsonSchemas = {
542
539
  errorMessage: { anyOf: [{ type: "string" }, { type: "null" }] },
543
540
  parts: { anyOf: [{ type: "number" }, { type: "null" }] },
544
541
  carrier: { anyOf: [{ type: "string" }, { type: "null" }] },
545
- whatsapp: { anyOf: [{ $ref: "#/$defs/WhatsAppMessageContent" }, { type: "null" }] },
546
- messageId: { type: "string" },
547
- organizationId: { type: "string" }
548
- },
549
- required: [
550
- "channel",
551
- "messageId",
552
- "organizationId"
553
- ],
554
- additionalProperties: true
555
- }
556
- },
557
- required: [
558
- "type",
559
- "timestamp",
560
- "data"
561
- ],
562
- additionalProperties: true,
563
- $defs: {
564
- MailboxId: {
565
- type: "string",
566
- pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
567
- },
568
- WhatsAppTextHeader: {
569
- type: "object",
570
- properties: {
571
- type: {
572
- type: "string",
573
- enum: ["text"]
574
- },
575
- text: {
576
- type: "string",
577
- minLength: 1,
578
- maxLength: 60
579
- }
580
- },
581
- required: ["type", "text"],
582
- additionalProperties: true
583
- },
584
- WhatsAppImageHeaderLink: {
585
- type: "object",
586
- properties: {
587
- type: {
588
- type: "string",
589
- enum: ["image"]
590
- },
591
- url: { type: "string" }
592
- },
593
- required: ["type", "url"],
594
- additionalProperties: true
595
- },
596
- MediaId: {
597
- type: "string",
598
- pattern: "^media_[0-9a-hjkmnp-tv-z]{16,24}$"
599
- },
600
- WhatsAppImageHeaderUpload: {
601
- type: "object",
602
- properties: {
603
- type: {
604
- type: "string",
605
- enum: ["image"]
606
- },
607
- mediaId: { $ref: "#/$defs/MediaId" }
608
- },
609
- required: ["type", "mediaId"],
610
- additionalProperties: true
611
- },
612
- WhatsAppImageHeader: { anyOf: [{ $ref: "#/$defs/WhatsAppImageHeaderLink" }, { $ref: "#/$defs/WhatsAppImageHeaderUpload" }] },
613
- WhatsAppVideoHeaderLink: {
614
- type: "object",
615
- properties: {
616
- type: {
617
- type: "string",
618
- enum: ["video"]
619
- },
620
- url: { type: "string" }
621
- },
622
- required: ["type", "url"],
623
- additionalProperties: true
624
- },
625
- WhatsAppVideoHeaderUpload: {
626
- type: "object",
627
- properties: {
628
- type: {
629
- type: "string",
630
- enum: ["video"]
631
- },
632
- mediaId: { $ref: "#/$defs/MediaId" }
633
- },
634
- required: ["type", "mediaId"],
635
- additionalProperties: true
636
- },
637
- WhatsAppVideoHeader: { anyOf: [{ $ref: "#/$defs/WhatsAppVideoHeaderLink" }, { $ref: "#/$defs/WhatsAppVideoHeaderUpload" }] },
638
- WhatsAppDocumentHeaderLink: {
639
- type: "object",
640
- properties: {
641
- type: {
642
- type: "string",
643
- enum: ["document"]
644
- },
645
- filename: {
646
- type: "string",
647
- minLength: 1,
648
- maxLength: 255
649
- },
650
- url: { type: "string" }
651
- },
652
- required: ["type", "url"],
653
- additionalProperties: true
654
- },
655
- WhatsAppDocumentHeaderUpload: {
656
- type: "object",
657
- properties: {
658
- type: {
659
- type: "string",
660
- enum: ["document"]
661
- },
662
- filename: {
663
- type: "string",
664
- minLength: 1,
665
- maxLength: 255
666
- },
667
- mediaId: { $ref: "#/$defs/MediaId" }
668
- },
669
- required: ["type", "mediaId"],
670
- additionalProperties: true
671
- },
672
- WhatsAppDocumentHeader: { anyOf: [{ $ref: "#/$defs/WhatsAppDocumentHeaderLink" }, { $ref: "#/$defs/WhatsAppDocumentHeaderUpload" }] },
673
- WhatsAppInteractiveHeader: { anyOf: [
674
- { $ref: "#/$defs/WhatsAppTextHeader" },
675
- { $ref: "#/$defs/WhatsAppImageHeader" },
676
- { $ref: "#/$defs/WhatsAppVideoHeader" },
677
- { $ref: "#/$defs/WhatsAppDocumentHeader" }
678
- ] },
679
- WhatsAppReplyButton: {
680
- type: "object",
681
- properties: {
682
- id: {
683
- type: "string",
684
- minLength: 1,
685
- maxLength: 256
686
- },
687
- title: {
688
- type: "string",
689
- minLength: 1,
690
- maxLength: 20
691
- }
692
- },
693
- required: ["id", "title"],
694
- additionalProperties: true
695
- },
696
- WhatsAppButtonsMessage: {
697
- type: "object",
698
- properties: {
699
- type: {
700
- type: "string",
701
- enum: ["buttons"]
702
- },
703
- header: { $ref: "#/$defs/WhatsAppInteractiveHeader" },
704
- body: {
705
- type: "string",
706
- minLength: 1,
707
- maxLength: 1024
708
- },
709
- footer: {
710
- type: "string",
711
- minLength: 1,
712
- maxLength: 60
713
- },
714
- buttons: {
715
- type: "array",
716
- items: { $ref: "#/$defs/WhatsAppReplyButton" },
717
- minItems: 1,
718
- maxItems: 3
719
- }
720
- },
721
- required: [
722
- "type",
723
- "body",
724
- "buttons"
725
- ],
726
- additionalProperties: true
727
- },
728
- WhatsAppListRow: {
729
- type: "object",
730
- properties: {
731
- id: {
732
- type: "string",
733
- minLength: 1,
734
- maxLength: 200
735
- },
736
- title: {
737
- type: "string",
738
- minLength: 1,
739
- maxLength: 24
740
- },
741
- description: {
742
- type: "string",
743
- minLength: 1,
744
- maxLength: 72
745
- }
746
- },
747
- required: ["id", "title"],
748
- additionalProperties: true
749
- },
750
- WhatsAppListSection: {
751
- type: "object",
752
- properties: {
753
- title: {
754
- type: "string",
755
- minLength: 1,
756
- maxLength: 24
757
- },
758
- rows: {
759
- type: "array",
760
- items: { $ref: "#/$defs/WhatsAppListRow" },
761
- minItems: 1
762
- }
763
- },
764
- required: ["rows"],
765
- additionalProperties: true
766
- },
767
- WhatsAppListMessage: {
768
- type: "object",
769
- properties: {
770
- type: {
771
- type: "string",
772
- enum: ["list"]
773
- },
774
- header: { $ref: "#/$defs/WhatsAppTextHeader" },
775
- body: {
776
- type: "string",
777
- minLength: 1,
778
- maxLength: 4096
779
- },
780
- footer: {
781
- type: "string",
782
- minLength: 1,
783
- maxLength: 60
784
- },
785
- button: {
786
- type: "string",
787
- minLength: 1,
788
- maxLength: 20
789
- },
790
- sections: {
791
- type: "array",
792
- items: { $ref: "#/$defs/WhatsAppListSection" },
793
- minItems: 1,
794
- maxItems: 10
795
- }
796
- },
797
- required: [
798
- "type",
799
- "body",
800
- "button",
801
- "sections"
802
- ],
803
- additionalProperties: true
804
- },
805
- WhatsAppCtaUrlMessage: {
806
- type: "object",
807
- properties: {
808
- type: {
809
- type: "string",
810
- enum: ["cta_url"]
811
- },
812
- header: { $ref: "#/$defs/WhatsAppInteractiveHeader" },
813
- body: {
814
- type: "string",
815
- minLength: 1,
816
- maxLength: 1024
817
- },
818
- footer: {
819
- type: "string",
820
- minLength: 1,
821
- maxLength: 60
822
- },
823
- displayText: {
824
- type: "string",
825
- minLength: 1,
826
- maxLength: 20
827
- },
828
- url: { type: "string" }
829
- },
830
- required: [
831
- "type",
832
- "body",
833
- "displayText",
834
- "url"
835
- ],
836
- additionalProperties: true
837
- },
838
- WhatsAppTextHeader_1: {
839
- type: "object",
840
- properties: {
841
- type: {
842
- type: "string",
843
- enum: ["text"]
844
- },
845
- text: {
846
- type: "string",
847
- minLength: 1,
848
- maxLength: 60
849
- }
850
- },
851
- required: ["type", "text"],
852
- additionalProperties: true
853
- },
854
- WhatsAppFlowId: {
855
- type: "string",
856
- pattern: "^waflow_[0-9a-hjkmnp-tv-z]{16,24}$"
857
- },
858
- WhatsAppFlowVersionId: {
859
- type: "string",
860
- pattern: "^wafver_[0-9a-hjkmnp-tv-z]{16,24}$"
861
- },
862
- WhatsAppStoredFlowMessage: {
863
- type: "object",
864
- properties: {
865
- type: {
866
- type: "string",
867
- enum: ["flow"]
868
- },
869
- header: { $ref: "#/$defs/WhatsAppTextHeader_1" },
870
- body: {
871
- type: "string",
872
- minLength: 1,
873
- maxLength: 1024
874
- },
875
- footer: {
876
- type: "string",
877
- minLength: 1,
878
- maxLength: 60
879
- },
880
- flowId: { $ref: "#/$defs/WhatsAppFlowId" },
881
- cta: {
882
- type: "string",
883
- minLength: 1,
884
- maxLength: 30
885
- },
886
- token: {
887
- type: "string",
888
- minLength: 1,
889
- maxLength: 1024
890
- },
891
- screen: {
892
- type: "string",
893
- pattern: "^[A-Za-z_]{1,100}$"
894
- },
895
- data: { type: "object" },
896
- flowVersionId: { $ref: "#/$defs/WhatsAppFlowVersionId" },
897
- providerFlowId: { type: "string" }
898
- },
899
- required: [
900
- "type",
901
- "body",
902
- "flowId",
903
- "cta",
904
- "flowVersionId",
905
- "providerFlowId"
906
- ],
907
- additionalProperties: true
908
- },
909
- WhatsAppStoredInteractive: { anyOf: [
910
- { $ref: "#/$defs/WhatsAppButtonsMessage" },
911
- { $ref: "#/$defs/WhatsAppListMessage" },
912
- { $ref: "#/$defs/WhatsAppCtaUrlMessage" },
913
- { $ref: "#/$defs/WhatsAppStoredFlowMessage" }
914
- ] },
915
- WhatsAppStoredMedia: { anyOf: [
916
- {
917
- type: "object",
918
- properties: {
919
- type: {
920
- type: "string",
921
- enum: [
922
- "image",
923
- "video",
924
- "audio",
925
- "document",
926
- "sticker"
927
- ]
928
- },
929
- url: { type: "string" },
930
- caption: { type: "string" },
931
- filename: { type: "string" }
932
- },
933
- required: ["type", "url"],
934
- additionalProperties: true
935
- },
936
- {
937
- type: "object",
938
- properties: {
939
- type: {
940
- type: "string",
941
- enum: [
942
- "image",
943
- "video",
944
- "audio",
945
- "document",
946
- "sticker"
947
- ]
948
- },
949
- mediaId: { $ref: "#/$defs/MediaId" },
950
- caption: { type: "string" },
951
- filename: { type: "string" }
952
- },
953
- required: ["type", "mediaId"],
954
- additionalProperties: true
955
- },
956
- {
957
- type: "object",
958
- properties: {
959
- type: {
960
- type: "string",
961
- enum: [
962
- "image",
963
- "video",
964
- "audio",
965
- "document",
966
- "sticker"
967
- ]
968
- },
969
- providerMediaId: { type: "string" },
970
- mimeType: { anyOf: [{ type: "string" }, { type: "null" }] },
971
- caption: { anyOf: [{ type: "string" }, { type: "null" }] },
972
- filename: { type: "string" }
973
- },
974
- required: ["type", "providerMediaId"],
975
- additionalProperties: true
976
- }
977
- ] },
978
- MessageId: {
979
- type: "string",
980
- pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
981
- },
982
- WhatsAppStoredReaction: {
983
- type: "object",
984
- properties: {
985
- messageId: { anyOf: [{ $ref: "#/$defs/MessageId" }, { type: "null" }] },
986
- providerMessageId: { type: "string" },
987
- emoji: { anyOf: [{ type: "string" }, { type: "null" }] }
988
- },
989
- required: [
990
- "messageId",
991
- "providerMessageId",
992
- "emoji"
993
- ],
994
- additionalProperties: true
995
- },
996
- WhatsAppStoredLocation: {
997
- type: "object",
998
- properties: {
999
- latitude: { type: "number" },
1000
- longitude: { type: "number" },
1001
- name: { type: "string" },
1002
- address: { type: "string" },
1003
- url: { type: "string" }
1004
- },
1005
- required: ["latitude", "longitude"],
1006
- additionalProperties: true
1007
- },
1008
- WhatsAppStoredContactCard: {
1009
- type: "object",
1010
- properties: {
1011
- name: {
542
+ whatsapp: { anyOf: [{
1012
543
  type: "object",
1013
544
  properties: {
1014
- formattedName: { type: "string" },
1015
- firstName: { type: "string" },
1016
- lastName: { type: "string" },
1017
- middleName: { type: "string" },
1018
- prefix: { type: "string" },
1019
- suffix: { type: "string" }
1020
- },
1021
- additionalProperties: true
1022
- },
1023
- phones: {
1024
- type: "array",
1025
- items: {
1026
- type: "object",
1027
- properties: {
1028
- phone: { type: "string" },
1029
- type: { type: "string" },
1030
- waId: { type: "string" }
1031
- },
1032
- additionalProperties: true
1033
- }
1034
- },
1035
- emails: {
1036
- type: "array",
1037
- items: {
1038
- type: "object",
1039
- properties: {
1040
- email: { type: "string" },
1041
- type: { type: "string" }
1042
- },
1043
- additionalProperties: true
1044
- }
1045
- },
1046
- urls: {
1047
- type: "array",
1048
- items: {
1049
- type: "object",
1050
- properties: {
1051
- url: { type: "string" },
1052
- type: { type: "string" }
1053
- },
1054
- additionalProperties: true
1055
- }
1056
- },
1057
- org: {
1058
- type: "object",
1059
- properties: {
1060
- company: { type: "string" },
1061
- department: { type: "string" },
1062
- title: { type: "string" }
1063
- },
1064
- additionalProperties: true
1065
- },
1066
- addresses: {
1067
- type: "array",
1068
- items: {
1069
- type: "object",
1070
- properties: {
1071
- street: { type: "string" },
1072
- city: { type: "string" },
1073
- state: { type: "string" },
1074
- zip: { type: "string" },
1075
- country: { type: "string" },
1076
- countryCode: { type: "string" },
1077
- type: { type: "string" }
1078
- },
1079
- additionalProperties: true
1080
- }
1081
- },
1082
- birthday: { type: "string" }
1083
- },
1084
- additionalProperties: true
1085
- },
1086
- WhatsAppReceivedReply: {
1087
- type: "object",
1088
- properties: {
1089
- type: {
1090
- type: "string",
1091
- enum: [
1092
- "button",
1093
- "list",
1094
- "template_button"
1095
- ]
1096
- },
1097
- id: { type: "string" },
1098
- title: { type: "string" },
1099
- description: { type: "string" }
1100
- },
1101
- required: [
1102
- "type",
1103
- "id",
1104
- "title"
1105
- ],
1106
- additionalProperties: true
1107
- },
1108
- WhatsAppReceivedFlowResponse: {
1109
- type: "object",
1110
- properties: {
1111
- flowToken: { anyOf: [{ type: "string" }, { type: "null" }] },
1112
- response: { type: "object" },
1113
- body: { type: "string" }
1114
- },
1115
- required: ["flowToken", "response"],
1116
- additionalProperties: true
1117
- },
1118
- WhatsAppMessageReference: {
1119
- type: "object",
1120
- properties: {
1121
- messageId: { anyOf: [{ $ref: "#/$defs/MessageId" }, { type: "null" }] },
1122
- providerMessageId: { type: "string" }
1123
- },
1124
- required: ["messageId", "providerMessageId"],
1125
- additionalProperties: true
1126
- },
1127
- WhatsAppMessageContent: {
1128
- type: "object",
1129
- properties: {
1130
- text: { anyOf: [{ type: "string" }, { type: "null" }] },
1131
- template: { anyOf: [{
1132
- type: "object",
1133
- properties: {
1134
- name: { type: "string" },
1135
- language: { type: "string" },
1136
- components: {
545
+ text: { anyOf: [{ type: "string" }, { type: "null" }] },
546
+ template: { anyOf: [{
547
+ type: "object",
548
+ properties: {
549
+ name: { type: "string" },
550
+ language: { type: "string" },
551
+ components: {
552
+ type: "array",
553
+ items: {
554
+ type: "object",
555
+ properties: {
556
+ type: {
557
+ type: "string",
558
+ enum: [
559
+ "header",
560
+ "body",
561
+ "footer",
562
+ "button"
563
+ ]
564
+ },
565
+ sub_type: { anyOf: [{
566
+ type: "string",
567
+ enum: [
568
+ "url",
569
+ "quick_reply",
570
+ "copy_code",
571
+ "flow"
572
+ ]
573
+ }, { type: "null" }] },
574
+ index: { anyOf: [{ type: "string" }, { type: "null" }] },
575
+ parameters: {
576
+ type: "array",
577
+ items: {
578
+ type: "object",
579
+ properties: {
580
+ type: {
581
+ type: "string",
582
+ enum: [
583
+ "text",
584
+ "currency",
585
+ "date_time",
586
+ "image",
587
+ "document",
588
+ "video",
589
+ "coupon_code",
590
+ "action"
591
+ ]
592
+ },
593
+ text: { anyOf: [{ type: "string" }, { type: "null" }] },
594
+ currency: { anyOf: [{
595
+ type: "object",
596
+ properties: {
597
+ fallback_value: { type: "string" },
598
+ code: { type: "string" },
599
+ amount_1000: { type: "number" }
600
+ },
601
+ required: [
602
+ "fallback_value",
603
+ "code",
604
+ "amount_1000"
605
+ ],
606
+ additionalProperties: true
607
+ }, { type: "null" }] },
608
+ date_time: { anyOf: [{
609
+ type: "object",
610
+ properties: { fallback_value: { type: "string" } },
611
+ required: ["fallback_value"],
612
+ additionalProperties: true
613
+ }, { type: "null" }] },
614
+ image: { anyOf: [{
615
+ type: "object",
616
+ properties: { link: { type: "string" } },
617
+ required: ["link"],
618
+ additionalProperties: true
619
+ }, { type: "null" }] },
620
+ document: { anyOf: [{
621
+ type: "object",
622
+ properties: {
623
+ link: { type: "string" },
624
+ filename: { anyOf: [{ type: "string" }, { type: "null" }] }
625
+ },
626
+ required: ["link"],
627
+ additionalProperties: true
628
+ }, { type: "null" }] },
629
+ video: { anyOf: [{
630
+ type: "object",
631
+ properties: { link: { type: "string" } },
632
+ required: ["link"],
633
+ additionalProperties: true
634
+ }, { type: "null" }] },
635
+ coupon_code: { anyOf: [{ type: "string" }, { type: "null" }] },
636
+ action: { anyOf: [{
637
+ type: "object",
638
+ properties: { flow_token: { type: "string" } },
639
+ required: ["flow_token"],
640
+ additionalProperties: true
641
+ }, { type: "null" }] }
642
+ },
643
+ required: ["type"],
644
+ additionalProperties: true
645
+ }
646
+ }
647
+ },
648
+ required: ["type", "parameters"],
649
+ additionalProperties: true
650
+ }
651
+ }
652
+ },
653
+ required: [
654
+ "name",
655
+ "language",
656
+ "components"
657
+ ],
658
+ additionalProperties: true
659
+ }, { type: "null" }] },
660
+ interactive: { anyOf: [
661
+ {
662
+ type: "object",
663
+ properties: {
664
+ type: {
665
+ type: "string",
666
+ enum: ["buttons"]
667
+ },
668
+ header: { anyOf: [
669
+ {
670
+ type: "object",
671
+ properties: {
672
+ type: {
673
+ type: "string",
674
+ enum: ["text"]
675
+ },
676
+ text: {
677
+ type: "string",
678
+ minLength: 1,
679
+ maxLength: 60
680
+ }
681
+ },
682
+ required: ["type", "text"],
683
+ additionalProperties: true
684
+ },
685
+ { anyOf: [{
686
+ type: "object",
687
+ properties: {
688
+ type: {
689
+ type: "string",
690
+ enum: ["image"]
691
+ },
692
+ url: { type: "string" }
693
+ },
694
+ required: ["type", "url"],
695
+ additionalProperties: true
696
+ }, {
697
+ type: "object",
698
+ properties: {
699
+ type: {
700
+ type: "string",
701
+ enum: ["image"]
702
+ },
703
+ mediaId: {
704
+ type: "string",
705
+ pattern: "^media_[0-9a-hjkmnp-tv-z]{16,24}$"
706
+ }
707
+ },
708
+ required: ["type", "mediaId"],
709
+ additionalProperties: true
710
+ }] },
711
+ { anyOf: [{
712
+ type: "object",
713
+ properties: {
714
+ type: {
715
+ type: "string",
716
+ enum: ["video"]
717
+ },
718
+ url: { type: "string" }
719
+ },
720
+ required: ["type", "url"],
721
+ additionalProperties: true
722
+ }, {
723
+ type: "object",
724
+ properties: {
725
+ type: {
726
+ type: "string",
727
+ enum: ["video"]
728
+ },
729
+ mediaId: {
730
+ type: "string",
731
+ pattern: "^media_[0-9a-hjkmnp-tv-z]{16,24}$"
732
+ }
733
+ },
734
+ required: ["type", "mediaId"],
735
+ additionalProperties: true
736
+ }] },
737
+ { anyOf: [{
738
+ type: "object",
739
+ properties: {
740
+ type: {
741
+ type: "string",
742
+ enum: ["document"]
743
+ },
744
+ filename: {
745
+ type: "string",
746
+ minLength: 1,
747
+ maxLength: 255
748
+ },
749
+ url: { type: "string" }
750
+ },
751
+ required: ["type", "url"],
752
+ additionalProperties: true
753
+ }, {
754
+ type: "object",
755
+ properties: {
756
+ type: {
757
+ type: "string",
758
+ enum: ["document"]
759
+ },
760
+ filename: {
761
+ type: "string",
762
+ minLength: 1,
763
+ maxLength: 255
764
+ },
765
+ mediaId: {
766
+ type: "string",
767
+ pattern: "^media_[0-9a-hjkmnp-tv-z]{16,24}$"
768
+ }
769
+ },
770
+ required: ["type", "mediaId"],
771
+ additionalProperties: true
772
+ }] }
773
+ ] },
774
+ body: {
775
+ type: "string",
776
+ minLength: 1,
777
+ maxLength: 1024
778
+ },
779
+ footer: {
780
+ type: "string",
781
+ minLength: 1,
782
+ maxLength: 60
783
+ },
784
+ buttons: {
785
+ type: "array",
786
+ items: {
787
+ type: "object",
788
+ properties: {
789
+ id: {
790
+ type: "string",
791
+ minLength: 1,
792
+ maxLength: 256
793
+ },
794
+ title: {
795
+ type: "string",
796
+ minLength: 1,
797
+ maxLength: 20
798
+ }
799
+ },
800
+ required: ["id", "title"],
801
+ additionalProperties: true
802
+ },
803
+ minItems: 1,
804
+ maxItems: 3
805
+ }
806
+ },
807
+ required: [
808
+ "type",
809
+ "body",
810
+ "buttons"
811
+ ],
812
+ additionalProperties: true
813
+ },
814
+ {
815
+ type: "object",
816
+ properties: {
817
+ type: {
818
+ type: "string",
819
+ enum: ["list"]
820
+ },
821
+ header: {
822
+ type: "object",
823
+ properties: {
824
+ type: {
825
+ type: "string",
826
+ enum: ["text"]
827
+ },
828
+ text: {
829
+ type: "string",
830
+ minLength: 1,
831
+ maxLength: 60
832
+ }
833
+ },
834
+ required: ["type", "text"],
835
+ additionalProperties: true
836
+ },
837
+ body: {
838
+ type: "string",
839
+ minLength: 1,
840
+ maxLength: 4096
841
+ },
842
+ footer: {
843
+ type: "string",
844
+ minLength: 1,
845
+ maxLength: 60
846
+ },
847
+ button: {
848
+ type: "string",
849
+ minLength: 1,
850
+ maxLength: 20
851
+ },
852
+ sections: {
853
+ type: "array",
854
+ items: {
855
+ type: "object",
856
+ properties: {
857
+ title: {
858
+ type: "string",
859
+ minLength: 1,
860
+ maxLength: 24
861
+ },
862
+ rows: {
863
+ type: "array",
864
+ items: {
865
+ type: "object",
866
+ properties: {
867
+ id: {
868
+ type: "string",
869
+ minLength: 1,
870
+ maxLength: 200
871
+ },
872
+ title: {
873
+ type: "string",
874
+ minLength: 1,
875
+ maxLength: 24
876
+ },
877
+ description: {
878
+ type: "string",
879
+ minLength: 1,
880
+ maxLength: 72
881
+ }
882
+ },
883
+ required: ["id", "title"],
884
+ additionalProperties: true
885
+ },
886
+ minItems: 1
887
+ }
888
+ },
889
+ required: ["rows"],
890
+ additionalProperties: true
891
+ },
892
+ minItems: 1,
893
+ maxItems: 10
894
+ }
895
+ },
896
+ required: [
897
+ "type",
898
+ "body",
899
+ "button",
900
+ "sections"
901
+ ],
902
+ additionalProperties: true
903
+ },
904
+ {
905
+ type: "object",
906
+ properties: {
907
+ type: {
908
+ type: "string",
909
+ enum: ["cta_url"]
910
+ },
911
+ header: { anyOf: [
912
+ {
913
+ type: "object",
914
+ properties: {
915
+ type: {
916
+ type: "string",
917
+ enum: ["text"]
918
+ },
919
+ text: {
920
+ type: "string",
921
+ minLength: 1,
922
+ maxLength: 60
923
+ }
924
+ },
925
+ required: ["type", "text"],
926
+ additionalProperties: true
927
+ },
928
+ { anyOf: [{
929
+ type: "object",
930
+ properties: {
931
+ type: {
932
+ type: "string",
933
+ enum: ["image"]
934
+ },
935
+ url: { type: "string" }
936
+ },
937
+ required: ["type", "url"],
938
+ additionalProperties: true
939
+ }, {
940
+ type: "object",
941
+ properties: {
942
+ type: {
943
+ type: "string",
944
+ enum: ["image"]
945
+ },
946
+ mediaId: {
947
+ type: "string",
948
+ pattern: "^media_[0-9a-hjkmnp-tv-z]{16,24}$"
949
+ }
950
+ },
951
+ required: ["type", "mediaId"],
952
+ additionalProperties: true
953
+ }] },
954
+ { anyOf: [{
955
+ type: "object",
956
+ properties: {
957
+ type: {
958
+ type: "string",
959
+ enum: ["video"]
960
+ },
961
+ url: { type: "string" }
962
+ },
963
+ required: ["type", "url"],
964
+ additionalProperties: true
965
+ }, {
966
+ type: "object",
967
+ properties: {
968
+ type: {
969
+ type: "string",
970
+ enum: ["video"]
971
+ },
972
+ mediaId: {
973
+ type: "string",
974
+ pattern: "^media_[0-9a-hjkmnp-tv-z]{16,24}$"
975
+ }
976
+ },
977
+ required: ["type", "mediaId"],
978
+ additionalProperties: true
979
+ }] },
980
+ { anyOf: [{
981
+ type: "object",
982
+ properties: {
983
+ type: {
984
+ type: "string",
985
+ enum: ["document"]
986
+ },
987
+ filename: {
988
+ type: "string",
989
+ minLength: 1,
990
+ maxLength: 255
991
+ },
992
+ url: { type: "string" }
993
+ },
994
+ required: ["type", "url"],
995
+ additionalProperties: true
996
+ }, {
997
+ type: "object",
998
+ properties: {
999
+ type: {
1000
+ type: "string",
1001
+ enum: ["document"]
1002
+ },
1003
+ filename: {
1004
+ type: "string",
1005
+ minLength: 1,
1006
+ maxLength: 255
1007
+ },
1008
+ mediaId: {
1009
+ type: "string",
1010
+ pattern: "^media_[0-9a-hjkmnp-tv-z]{16,24}$"
1011
+ }
1012
+ },
1013
+ required: ["type", "mediaId"],
1014
+ additionalProperties: true
1015
+ }] }
1016
+ ] },
1017
+ body: {
1018
+ type: "string",
1019
+ minLength: 1,
1020
+ maxLength: 1024
1021
+ },
1022
+ footer: {
1023
+ type: "string",
1024
+ minLength: 1,
1025
+ maxLength: 60
1026
+ },
1027
+ displayText: {
1028
+ type: "string",
1029
+ minLength: 1,
1030
+ maxLength: 20
1031
+ },
1032
+ url: { type: "string" }
1033
+ },
1034
+ required: [
1035
+ "type",
1036
+ "body",
1037
+ "displayText",
1038
+ "url"
1039
+ ],
1040
+ additionalProperties: true
1041
+ },
1042
+ {
1043
+ type: "object",
1044
+ properties: {
1045
+ type: {
1046
+ type: "string",
1047
+ enum: ["flow"]
1048
+ },
1049
+ header: {
1050
+ type: "object",
1051
+ properties: {
1052
+ type: {
1053
+ type: "string",
1054
+ enum: ["text"]
1055
+ },
1056
+ text: {
1057
+ type: "string",
1058
+ minLength: 1,
1059
+ maxLength: 60
1060
+ }
1061
+ },
1062
+ required: ["type", "text"],
1063
+ additionalProperties: true
1064
+ },
1065
+ body: {
1066
+ type: "string",
1067
+ minLength: 1,
1068
+ maxLength: 1024
1069
+ },
1070
+ footer: {
1071
+ type: "string",
1072
+ minLength: 1,
1073
+ maxLength: 60
1074
+ },
1075
+ flowId: {
1076
+ type: "string",
1077
+ pattern: "^waflow_[0-9a-hjkmnp-tv-z]{16,24}$"
1078
+ },
1079
+ cta: {
1080
+ type: "string",
1081
+ minLength: 1,
1082
+ maxLength: 30
1083
+ },
1084
+ token: {
1085
+ type: "string",
1086
+ minLength: 1,
1087
+ maxLength: 1024
1088
+ },
1089
+ action: {
1090
+ type: "string",
1091
+ enum: ["navigate", "data_exchange"]
1092
+ },
1093
+ screen: {
1094
+ type: "string",
1095
+ pattern: "^[A-Za-z_]{1,100}$"
1096
+ },
1097
+ data: { type: "object" },
1098
+ flowVersionId: {
1099
+ type: "string",
1100
+ pattern: "^wafver_[0-9a-hjkmnp-tv-z]{16,24}$"
1101
+ },
1102
+ providerFlowId: { type: "string" }
1103
+ },
1104
+ required: [
1105
+ "type",
1106
+ "body",
1107
+ "flowId",
1108
+ "cta",
1109
+ "flowVersionId",
1110
+ "providerFlowId"
1111
+ ],
1112
+ additionalProperties: true
1113
+ }
1114
+ ] },
1115
+ media: { anyOf: [{ anyOf: [
1116
+ {
1117
+ type: "object",
1118
+ properties: {
1119
+ type: {
1120
+ type: "string",
1121
+ enum: [
1122
+ "image",
1123
+ "video",
1124
+ "audio",
1125
+ "document",
1126
+ "sticker"
1127
+ ]
1128
+ },
1129
+ url: { type: "string" },
1130
+ caption: { type: "string" },
1131
+ filename: { type: "string" }
1132
+ },
1133
+ required: ["type", "url"],
1134
+ additionalProperties: true
1135
+ },
1136
+ {
1137
+ type: "object",
1138
+ properties: {
1139
+ type: {
1140
+ type: "string",
1141
+ enum: [
1142
+ "image",
1143
+ "video",
1144
+ "audio",
1145
+ "document",
1146
+ "sticker"
1147
+ ]
1148
+ },
1149
+ mediaId: {
1150
+ type: "string",
1151
+ pattern: "^media_[0-9a-hjkmnp-tv-z]{16,24}$"
1152
+ },
1153
+ caption: { type: "string" },
1154
+ filename: { type: "string" }
1155
+ },
1156
+ required: ["type", "mediaId"],
1157
+ additionalProperties: true
1158
+ },
1159
+ {
1160
+ type: "object",
1161
+ properties: {
1162
+ type: {
1163
+ type: "string",
1164
+ enum: [
1165
+ "image",
1166
+ "video",
1167
+ "audio",
1168
+ "document",
1169
+ "sticker"
1170
+ ]
1171
+ },
1172
+ providerMediaId: { type: "string" },
1173
+ mimeType: { anyOf: [{ type: "string" }, { type: "null" }] },
1174
+ caption: { anyOf: [{ type: "string" }, { type: "null" }] },
1175
+ filename: { type: "string" }
1176
+ },
1177
+ required: ["type", "providerMediaId"],
1178
+ additionalProperties: true
1179
+ }
1180
+ ] }, { type: "null" }] },
1181
+ reaction: {
1182
+ type: "object",
1183
+ properties: {
1184
+ messageId: { anyOf: [{
1185
+ type: "string",
1186
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
1187
+ }, { type: "null" }] },
1188
+ providerMessageId: { type: "string" },
1189
+ emoji: { anyOf: [{ type: "string" }, { type: "null" }] }
1190
+ },
1191
+ required: [
1192
+ "messageId",
1193
+ "providerMessageId",
1194
+ "emoji"
1195
+ ],
1196
+ additionalProperties: true
1197
+ },
1198
+ location: {
1199
+ type: "object",
1200
+ properties: {
1201
+ latitude: { type: "number" },
1202
+ longitude: { type: "number" },
1203
+ name: { type: "string" },
1204
+ address: { type: "string" },
1205
+ url: { type: "string" }
1206
+ },
1207
+ required: ["latitude", "longitude"],
1208
+ additionalProperties: true
1209
+ },
1210
+ contacts: {
1137
1211
  type: "array",
1138
1212
  items: {
1139
1213
  type: "object",
1140
1214
  properties: {
1141
- type: {
1142
- type: "string",
1143
- enum: [
1144
- "header",
1145
- "body",
1146
- "footer",
1147
- "button"
1148
- ]
1215
+ name: {
1216
+ type: "object",
1217
+ properties: {
1218
+ formattedName: { type: "string" },
1219
+ firstName: { type: "string" },
1220
+ lastName: { type: "string" },
1221
+ middleName: { type: "string" },
1222
+ prefix: { type: "string" },
1223
+ suffix: { type: "string" }
1224
+ },
1225
+ additionalProperties: true
1149
1226
  },
1150
- sub_type: { anyOf: [{
1151
- type: "string",
1152
- enum: [
1153
- "url",
1154
- "quick_reply",
1155
- "copy_code"
1156
- ]
1157
- }, { type: "null" }] },
1158
- index: { anyOf: [{ type: "string" }, { type: "null" }] },
1159
- parameters: {
1227
+ phones: {
1160
1228
  type: "array",
1161
1229
  items: {
1162
1230
  type: "object",
1163
1231
  properties: {
1164
- type: {
1165
- type: "string",
1166
- enum: [
1167
- "text",
1168
- "currency",
1169
- "date_time",
1170
- "image",
1171
- "document",
1172
- "video",
1173
- "coupon_code"
1174
- ]
1175
- },
1176
- text: { anyOf: [{ type: "string" }, { type: "null" }] },
1177
- currency: { anyOf: [{
1178
- type: "object",
1179
- properties: {
1180
- fallback_value: { type: "string" },
1181
- code: { type: "string" },
1182
- amount_1000: { type: "number" }
1183
- },
1184
- required: [
1185
- "fallback_value",
1186
- "code",
1187
- "amount_1000"
1188
- ],
1189
- additionalProperties: true
1190
- }, { type: "null" }] },
1191
- date_time: { anyOf: [{
1192
- type: "object",
1193
- properties: { fallback_value: { type: "string" } },
1194
- required: ["fallback_value"],
1195
- additionalProperties: true
1196
- }, { type: "null" }] },
1197
- image: { anyOf: [{
1198
- type: "object",
1199
- properties: { link: { type: "string" } },
1200
- required: ["link"],
1201
- additionalProperties: true
1202
- }, { type: "null" }] },
1203
- document: { anyOf: [{
1204
- type: "object",
1205
- properties: {
1206
- link: { type: "string" },
1207
- filename: { anyOf: [{ type: "string" }, { type: "null" }] }
1208
- },
1209
- required: ["link"],
1210
- additionalProperties: true
1211
- }, { type: "null" }] },
1212
- video: { anyOf: [{
1213
- type: "object",
1214
- properties: { link: { type: "string" } },
1215
- required: ["link"],
1216
- additionalProperties: true
1217
- }, { type: "null" }] },
1218
- coupon_code: { anyOf: [{ type: "string" }, { type: "null" }] }
1232
+ phone: { type: "string" },
1233
+ type: { type: "string" },
1234
+ waId: { type: "string" }
1219
1235
  },
1220
- required: ["type"],
1221
1236
  additionalProperties: true
1222
1237
  }
1223
- }
1238
+ },
1239
+ emails: {
1240
+ type: "array",
1241
+ items: {
1242
+ type: "object",
1243
+ properties: {
1244
+ email: { type: "string" },
1245
+ type: { type: "string" }
1246
+ },
1247
+ additionalProperties: true
1248
+ }
1249
+ },
1250
+ urls: {
1251
+ type: "array",
1252
+ items: {
1253
+ type: "object",
1254
+ properties: {
1255
+ url: { type: "string" },
1256
+ type: { type: "string" }
1257
+ },
1258
+ additionalProperties: true
1259
+ }
1260
+ },
1261
+ org: {
1262
+ type: "object",
1263
+ properties: {
1264
+ company: { type: "string" },
1265
+ department: { type: "string" },
1266
+ title: { type: "string" }
1267
+ },
1268
+ additionalProperties: true
1269
+ },
1270
+ addresses: {
1271
+ type: "array",
1272
+ items: {
1273
+ type: "object",
1274
+ properties: {
1275
+ street: { type: "string" },
1276
+ city: { type: "string" },
1277
+ state: { type: "string" },
1278
+ zip: { type: "string" },
1279
+ country: { type: "string" },
1280
+ countryCode: { type: "string" },
1281
+ type: { type: "string" }
1282
+ },
1283
+ additionalProperties: true
1284
+ }
1285
+ },
1286
+ birthday: { type: "string" }
1224
1287
  },
1225
- required: ["type", "parameters"],
1226
1288
  additionalProperties: true
1227
1289
  }
1290
+ },
1291
+ reply: {
1292
+ type: "object",
1293
+ properties: {
1294
+ type: {
1295
+ type: "string",
1296
+ enum: [
1297
+ "button",
1298
+ "list",
1299
+ "template_button"
1300
+ ]
1301
+ },
1302
+ id: { type: "string" },
1303
+ title: { type: "string" },
1304
+ description: { type: "string" }
1305
+ },
1306
+ required: [
1307
+ "type",
1308
+ "id",
1309
+ "title"
1310
+ ],
1311
+ additionalProperties: true
1312
+ },
1313
+ flowResponse: {
1314
+ type: "object",
1315
+ properties: {
1316
+ flowToken: { anyOf: [{ type: "string" }, { type: "null" }] },
1317
+ response: { type: "object" },
1318
+ body: { type: "string" }
1319
+ },
1320
+ required: ["flowToken", "response"],
1321
+ additionalProperties: true
1322
+ },
1323
+ context: {
1324
+ type: "object",
1325
+ properties: {
1326
+ messageId: { anyOf: [{
1327
+ type: "string",
1328
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
1329
+ }, { type: "null" }] },
1330
+ providerMessageId: { type: "string" }
1331
+ },
1332
+ required: ["messageId", "providerMessageId"],
1333
+ additionalProperties: true
1228
1334
  }
1229
1335
  },
1230
- required: [
1231
- "name",
1232
- "language",
1233
- "components"
1234
- ],
1235
1336
  additionalProperties: true
1236
1337
  }, { type: "null" }] },
1237
- interactive: { $ref: "#/$defs/WhatsAppStoredInteractive" },
1238
- media: { anyOf: [{ $ref: "#/$defs/WhatsAppStoredMedia" }, { type: "null" }] },
1239
- reaction: { $ref: "#/$defs/WhatsAppStoredReaction" },
1240
- location: { $ref: "#/$defs/WhatsAppStoredLocation" },
1241
- contacts: {
1242
- type: "array",
1243
- items: { $ref: "#/$defs/WhatsAppStoredContactCard" }
1244
- },
1245
- reply: { $ref: "#/$defs/WhatsAppReceivedReply" },
1246
- flowResponse: { $ref: "#/$defs/WhatsAppReceivedFlowResponse" },
1247
- context: { $ref: "#/$defs/WhatsAppMessageReference" }
1338
+ messageId: { type: "string" },
1339
+ organizationId: { type: "string" }
1248
1340
  },
1341
+ required: [
1342
+ "channel",
1343
+ "messageId",
1344
+ "organizationId"
1345
+ ],
1249
1346
  additionalProperties: true
1250
1347
  }
1251
- }
1348
+ },
1349
+ required: [
1350
+ "type",
1351
+ "timestamp",
1352
+ "data"
1353
+ ],
1354
+ additionalProperties: true
1252
1355
  },
1253
1356
  "message.opened": {
1254
1357
  type: "object",
@@ -1261,13 +1364,22 @@ const WebhookEventJsonSchemas = {
1261
1364
  data: {
1262
1365
  type: "object",
1263
1366
  properties: {
1264
- messageId: { $ref: "#/$defs/MessageId" },
1265
- organizationId: { $ref: "#/$defs/OrganizationId" },
1367
+ messageId: {
1368
+ type: "string",
1369
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
1370
+ },
1371
+ organizationId: {
1372
+ type: "string",
1373
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1374
+ },
1266
1375
  channel: {
1267
1376
  type: "string",
1268
1377
  enum: ["email"]
1269
1378
  },
1270
- deliveryId: { $ref: "#/$defs/MessageDeliveryId" },
1379
+ deliveryId: {
1380
+ type: "string",
1381
+ pattern: "^mdel_[0-9a-hjkmnp-tv-z]{16,24}$"
1382
+ },
1271
1383
  recipient: { type: "string" },
1272
1384
  occurredAt: { type: "string" },
1273
1385
  userAgent: { anyOf: [{ type: "string" }, { type: "null" }] },
@@ -1291,8 +1403,14 @@ const WebhookEventJsonSchemas = {
1291
1403
  linkIndex: { anyOf: [{ type: "number" }, { type: "null" }] },
1292
1404
  destinationUrl: { anyOf: [{ type: "string" }, { type: "null" }] },
1293
1405
  metadata: { anyOf: [{ type: "object" }, { type: "null" }] },
1294
- campaignId: { anyOf: [{ $ref: "#/$defs/CampaignId" }, { type: "null" }] },
1295
- campaignRunId: { anyOf: [{ $ref: "#/$defs/CampaignRunId" }, { type: "null" }] }
1406
+ campaignId: { anyOf: [{
1407
+ type: "string",
1408
+ pattern: "^camp_[0-9a-hjkmnp-tv-z]{16,24}$"
1409
+ }, { type: "null" }] },
1410
+ campaignRunId: { anyOf: [{
1411
+ type: "string",
1412
+ pattern: "^crun_[0-9a-hjkmnp-tv-z]{16,24}$"
1413
+ }, { type: "null" }] }
1296
1414
  },
1297
1415
  required: [
1298
1416
  "messageId",
@@ -1313,29 +1431,7 @@ const WebhookEventJsonSchemas = {
1313
1431
  "timestamp",
1314
1432
  "data"
1315
1433
  ],
1316
- additionalProperties: true,
1317
- $defs: {
1318
- MessageId: {
1319
- type: "string",
1320
- pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
1321
- },
1322
- OrganizationId: {
1323
- type: "string",
1324
- pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1325
- },
1326
- MessageDeliveryId: {
1327
- type: "string",
1328
- pattern: "^mdel_[0-9a-hjkmnp-tv-z]{16,24}$"
1329
- },
1330
- CampaignId: {
1331
- type: "string",
1332
- pattern: "^camp_[0-9a-hjkmnp-tv-z]{16,24}$"
1333
- },
1334
- CampaignRunId: {
1335
- type: "string",
1336
- pattern: "^crun_[0-9a-hjkmnp-tv-z]{16,24}$"
1337
- }
1338
- }
1434
+ additionalProperties: true
1339
1435
  },
1340
1436
  "message.clicked": {
1341
1437
  type: "object",
@@ -1348,13 +1444,22 @@ const WebhookEventJsonSchemas = {
1348
1444
  data: {
1349
1445
  type: "object",
1350
1446
  properties: {
1351
- messageId: { $ref: "#/$defs/MessageId" },
1352
- organizationId: { $ref: "#/$defs/OrganizationId" },
1447
+ messageId: {
1448
+ type: "string",
1449
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
1450
+ },
1451
+ organizationId: {
1452
+ type: "string",
1453
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1454
+ },
1353
1455
  channel: {
1354
1456
  type: "string",
1355
1457
  enum: ["email"]
1356
1458
  },
1357
- deliveryId: { $ref: "#/$defs/MessageDeliveryId" },
1459
+ deliveryId: {
1460
+ type: "string",
1461
+ pattern: "^mdel_[0-9a-hjkmnp-tv-z]{16,24}$"
1462
+ },
1358
1463
  recipient: { type: "string" },
1359
1464
  occurredAt: { type: "string" },
1360
1465
  userAgent: { anyOf: [{ type: "string" }, { type: "null" }] },
@@ -1386,8 +1491,14 @@ const WebhookEventJsonSchemas = {
1386
1491
  linkIndex: { anyOf: [{ type: "number" }, { type: "null" }] },
1387
1492
  destinationUrl: { anyOf: [{ type: "string" }, { type: "null" }] },
1388
1493
  metadata: { anyOf: [{ type: "object" }, { type: "null" }] },
1389
- campaignId: { anyOf: [{ $ref: "#/$defs/CampaignId" }, { type: "null" }] },
1390
- campaignRunId: { anyOf: [{ $ref: "#/$defs/CampaignRunId" }, { type: "null" }] }
1494
+ campaignId: { anyOf: [{
1495
+ type: "string",
1496
+ pattern: "^camp_[0-9a-hjkmnp-tv-z]{16,24}$"
1497
+ }, { type: "null" }] },
1498
+ campaignRunId: { anyOf: [{
1499
+ type: "string",
1500
+ pattern: "^crun_[0-9a-hjkmnp-tv-z]{16,24}$"
1501
+ }, { type: "null" }] }
1391
1502
  },
1392
1503
  required: [
1393
1504
  "messageId",
@@ -1410,29 +1521,7 @@ const WebhookEventJsonSchemas = {
1410
1521
  "timestamp",
1411
1522
  "data"
1412
1523
  ],
1413
- additionalProperties: true,
1414
- $defs: {
1415
- MessageId: {
1416
- type: "string",
1417
- pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
1418
- },
1419
- OrganizationId: {
1420
- type: "string",
1421
- pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1422
- },
1423
- MessageDeliveryId: {
1424
- type: "string",
1425
- pattern: "^mdel_[0-9a-hjkmnp-tv-z]{16,24}$"
1426
- },
1427
- CampaignId: {
1428
- type: "string",
1429
- pattern: "^camp_[0-9a-hjkmnp-tv-z]{16,24}$"
1430
- },
1431
- CampaignRunId: {
1432
- type: "string",
1433
- pattern: "^crun_[0-9a-hjkmnp-tv-z]{16,24}$"
1434
- }
1435
- }
1524
+ additionalProperties: true
1436
1525
  },
1437
1526
  "contact.created": {
1438
1527
  type: "object",
@@ -1445,7 +1534,10 @@ const WebhookEventJsonSchemas = {
1445
1534
  data: {
1446
1535
  type: "object",
1447
1536
  properties: {
1448
- contactId: { $ref: "#/$defs/ContactId" },
1537
+ contactId: {
1538
+ type: "string",
1539
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
1540
+ },
1449
1541
  status: {
1450
1542
  type: "string",
1451
1543
  enum: [
@@ -1459,7 +1551,23 @@ const WebhookEventJsonSchemas = {
1459
1551
  displayName: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
1460
1552
  identities: {
1461
1553
  type: "array",
1462
- items: { $ref: "#/$defs/ContactEventIdentity" }
1554
+ items: {
1555
+ type: "object",
1556
+ properties: {
1557
+ type: {
1558
+ type: "string",
1559
+ enum: ["email", "phone"]
1560
+ },
1561
+ identifier: { type: "string" },
1562
+ verified: { type: "boolean" }
1563
+ },
1564
+ required: [
1565
+ "type",
1566
+ "identifier",
1567
+ "verified"
1568
+ ],
1569
+ additionalProperties: true
1570
+ }
1463
1571
  },
1464
1572
  tags: {
1465
1573
  type: "array",
@@ -1486,30 +1594,7 @@ const WebhookEventJsonSchemas = {
1486
1594
  "timestamp",
1487
1595
  "data"
1488
1596
  ],
1489
- additionalProperties: true,
1490
- $defs: {
1491
- ContactId: {
1492
- type: "string",
1493
- pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
1494
- },
1495
- ContactEventIdentity: {
1496
- type: "object",
1497
- properties: {
1498
- type: {
1499
- type: "string",
1500
- enum: ["email", "phone"]
1501
- },
1502
- identifier: { type: "string" },
1503
- verified: { type: "boolean" }
1504
- },
1505
- required: [
1506
- "type",
1507
- "identifier",
1508
- "verified"
1509
- ],
1510
- additionalProperties: true
1511
- }
1512
- }
1597
+ additionalProperties: true
1513
1598
  },
1514
1599
  "contact.updated": {
1515
1600
  type: "object",
@@ -1522,7 +1607,10 @@ const WebhookEventJsonSchemas = {
1522
1607
  data: {
1523
1608
  type: "object",
1524
1609
  properties: {
1525
- contactId: { $ref: "#/$defs/ContactId" },
1610
+ contactId: {
1611
+ type: "string",
1612
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
1613
+ },
1526
1614
  status: {
1527
1615
  type: "string",
1528
1616
  enum: [
@@ -1536,7 +1624,23 @@ const WebhookEventJsonSchemas = {
1536
1624
  displayName: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
1537
1625
  identities: {
1538
1626
  type: "array",
1539
- items: { $ref: "#/$defs/ContactEventIdentity" }
1627
+ items: {
1628
+ type: "object",
1629
+ properties: {
1630
+ type: {
1631
+ type: "string",
1632
+ enum: ["email", "phone"]
1633
+ },
1634
+ identifier: { type: "string" },
1635
+ verified: { type: "boolean" }
1636
+ },
1637
+ required: [
1638
+ "type",
1639
+ "identifier",
1640
+ "verified"
1641
+ ],
1642
+ additionalProperties: true
1643
+ }
1540
1644
  },
1541
1645
  tags: {
1542
1646
  type: "array",
@@ -1563,30 +1667,7 @@ const WebhookEventJsonSchemas = {
1563
1667
  "timestamp",
1564
1668
  "data"
1565
1669
  ],
1566
- additionalProperties: true,
1567
- $defs: {
1568
- ContactId: {
1569
- type: "string",
1570
- pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
1571
- },
1572
- ContactEventIdentity: {
1573
- type: "object",
1574
- properties: {
1575
- type: {
1576
- type: "string",
1577
- enum: ["email", "phone"]
1578
- },
1579
- identifier: { type: "string" },
1580
- verified: { type: "boolean" }
1581
- },
1582
- required: [
1583
- "type",
1584
- "identifier",
1585
- "verified"
1586
- ],
1587
- additionalProperties: true
1588
- }
1589
- }
1670
+ additionalProperties: true
1590
1671
  },
1591
1672
  "contact.deleted": {
1592
1673
  type: "object",
@@ -1599,7 +1680,10 @@ const WebhookEventJsonSchemas = {
1599
1680
  data: {
1600
1681
  type: "object",
1601
1682
  properties: {
1602
- contactId: { $ref: "#/$defs/ContactId" },
1683
+ contactId: {
1684
+ type: "string",
1685
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
1686
+ },
1603
1687
  status: {
1604
1688
  type: "string",
1605
1689
  enum: [
@@ -1613,7 +1697,23 @@ const WebhookEventJsonSchemas = {
1613
1697
  displayName: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
1614
1698
  identities: {
1615
1699
  type: "array",
1616
- items: { $ref: "#/$defs/ContactEventIdentity" }
1700
+ items: {
1701
+ type: "object",
1702
+ properties: {
1703
+ type: {
1704
+ type: "string",
1705
+ enum: ["email", "phone"]
1706
+ },
1707
+ identifier: { type: "string" },
1708
+ verified: { type: "boolean" }
1709
+ },
1710
+ required: [
1711
+ "type",
1712
+ "identifier",
1713
+ "verified"
1714
+ ],
1715
+ additionalProperties: true
1716
+ }
1617
1717
  },
1618
1718
  tags: {
1619
1719
  type: "array",
@@ -1640,30 +1740,7 @@ const WebhookEventJsonSchemas = {
1640
1740
  "timestamp",
1641
1741
  "data"
1642
1742
  ],
1643
- additionalProperties: true,
1644
- $defs: {
1645
- ContactId: {
1646
- type: "string",
1647
- pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
1648
- },
1649
- ContactEventIdentity: {
1650
- type: "object",
1651
- properties: {
1652
- type: {
1653
- type: "string",
1654
- enum: ["email", "phone"]
1655
- },
1656
- identifier: { type: "string" },
1657
- verified: { type: "boolean" }
1658
- },
1659
- required: [
1660
- "type",
1661
- "identifier",
1662
- "verified"
1663
- ],
1664
- additionalProperties: true
1665
- }
1666
- }
1743
+ additionalProperties: true
1667
1744
  },
1668
1745
  "contact.subscribed": {
1669
1746
  type: "object",
@@ -1676,13 +1753,25 @@ const WebhookEventJsonSchemas = {
1676
1753
  data: {
1677
1754
  type: "object",
1678
1755
  properties: {
1679
- organizationId: { $ref: "#/$defs/OrganizationId" },
1680
- contactId: { $ref: "#/$defs/ContactId" },
1756
+ organizationId: {
1757
+ type: "string",
1758
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1759
+ },
1760
+ contactId: {
1761
+ type: "string",
1762
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
1763
+ },
1681
1764
  email: { anyOf: [{ type: "string" }, { type: "null" }] },
1682
1765
  groupId: { type: "string" },
1683
1766
  groupName: { type: "string" },
1684
- contactGroupId: { anyOf: [{ $ref: "#/$defs/ContactGroupId" }, { type: "null" }] },
1685
- unsubscribeGroupId: { anyOf: [{ $ref: "#/$defs/UnsubscribeId" }, { type: "null" }] },
1767
+ contactGroupId: { anyOf: [{
1768
+ type: "string",
1769
+ pattern: "^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$"
1770
+ }, { type: "null" }] },
1771
+ unsubscribeGroupId: { anyOf: [{
1772
+ type: "string",
1773
+ pattern: "^unsub_[0-9a-hjkmnp-tv-z]{16,24}$"
1774
+ }, { type: "null" }] },
1686
1775
  consentIp: { anyOf: [{ type: "string" }, { type: "null" }] },
1687
1776
  consentSource: { anyOf: [{ type: "string" }, { type: "null" }] },
1688
1777
  source: {
@@ -1694,9 +1783,18 @@ const WebhookEventJsonSchemas = {
1694
1783
  "complaint"
1695
1784
  ]
1696
1785
  },
1697
- messageId: { anyOf: [{ $ref: "#/$defs/MessageId" }, { type: "null" }] },
1698
- campaignId: { anyOf: [{ $ref: "#/$defs/CampaignId" }, { type: "null" }] },
1699
- campaignRunId: { anyOf: [{ $ref: "#/$defs/CampaignRunId" }, { type: "null" }] },
1786
+ messageId: { anyOf: [{
1787
+ type: "string",
1788
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
1789
+ }, { type: "null" }] },
1790
+ campaignId: { anyOf: [{
1791
+ type: "string",
1792
+ pattern: "^camp_[0-9a-hjkmnp-tv-z]{16,24}$"
1793
+ }, { type: "null" }] },
1794
+ campaignRunId: { anyOf: [{
1795
+ type: "string",
1796
+ pattern: "^crun_[0-9a-hjkmnp-tv-z]{16,24}$"
1797
+ }, { type: "null" }] },
1700
1798
  occurredAt: { type: "string" }
1701
1799
  },
1702
1800
  required: [
@@ -1715,37 +1813,7 @@ const WebhookEventJsonSchemas = {
1715
1813
  "timestamp",
1716
1814
  "data"
1717
1815
  ],
1718
- additionalProperties: true,
1719
- $defs: {
1720
- OrganizationId: {
1721
- type: "string",
1722
- pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1723
- },
1724
- ContactId: {
1725
- type: "string",
1726
- pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
1727
- },
1728
- ContactGroupId: {
1729
- type: "string",
1730
- pattern: "^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$"
1731
- },
1732
- UnsubscribeId: {
1733
- type: "string",
1734
- pattern: "^unsub_[0-9a-hjkmnp-tv-z]{16,24}$"
1735
- },
1736
- MessageId: {
1737
- type: "string",
1738
- pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
1739
- },
1740
- CampaignId: {
1741
- type: "string",
1742
- pattern: "^camp_[0-9a-hjkmnp-tv-z]{16,24}$"
1743
- },
1744
- CampaignRunId: {
1745
- type: "string",
1746
- pattern: "^crun_[0-9a-hjkmnp-tv-z]{16,24}$"
1747
- }
1748
- }
1816
+ additionalProperties: true
1749
1817
  },
1750
1818
  "contact.unsubscribed": {
1751
1819
  type: "object",
@@ -1758,13 +1826,25 @@ const WebhookEventJsonSchemas = {
1758
1826
  data: {
1759
1827
  type: "object",
1760
1828
  properties: {
1761
- organizationId: { $ref: "#/$defs/OrganizationId" },
1762
- contactId: { $ref: "#/$defs/ContactId" },
1829
+ organizationId: {
1830
+ type: "string",
1831
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1832
+ },
1833
+ contactId: {
1834
+ type: "string",
1835
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
1836
+ },
1763
1837
  email: { anyOf: [{ type: "string" }, { type: "null" }] },
1764
1838
  groupId: { type: "string" },
1765
1839
  groupName: { type: "string" },
1766
- contactGroupId: { anyOf: [{ $ref: "#/$defs/ContactGroupId" }, { type: "null" }] },
1767
- unsubscribeGroupId: { anyOf: [{ $ref: "#/$defs/UnsubscribeId" }, { type: "null" }] },
1840
+ contactGroupId: { anyOf: [{
1841
+ type: "string",
1842
+ pattern: "^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$"
1843
+ }, { type: "null" }] },
1844
+ unsubscribeGroupId: { anyOf: [{
1845
+ type: "string",
1846
+ pattern: "^unsub_[0-9a-hjkmnp-tv-z]{16,24}$"
1847
+ }, { type: "null" }] },
1768
1848
  consentIp: { anyOf: [{ type: "string" }, { type: "null" }] },
1769
1849
  consentSource: { anyOf: [{ type: "string" }, { type: "null" }] },
1770
1850
  source: {
@@ -1776,9 +1856,18 @@ const WebhookEventJsonSchemas = {
1776
1856
  "complaint"
1777
1857
  ]
1778
1858
  },
1779
- messageId: { anyOf: [{ $ref: "#/$defs/MessageId" }, { type: "null" }] },
1780
- campaignId: { anyOf: [{ $ref: "#/$defs/CampaignId" }, { type: "null" }] },
1781
- campaignRunId: { anyOf: [{ $ref: "#/$defs/CampaignRunId" }, { type: "null" }] },
1859
+ messageId: { anyOf: [{
1860
+ type: "string",
1861
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
1862
+ }, { type: "null" }] },
1863
+ campaignId: { anyOf: [{
1864
+ type: "string",
1865
+ pattern: "^camp_[0-9a-hjkmnp-tv-z]{16,24}$"
1866
+ }, { type: "null" }] },
1867
+ campaignRunId: { anyOf: [{
1868
+ type: "string",
1869
+ pattern: "^crun_[0-9a-hjkmnp-tv-z]{16,24}$"
1870
+ }, { type: "null" }] },
1782
1871
  occurredAt: { type: "string" }
1783
1872
  },
1784
1873
  required: [
@@ -1796,38 +1885,8 @@ const WebhookEventJsonSchemas = {
1796
1885
  "type",
1797
1886
  "timestamp",
1798
1887
  "data"
1799
- ],
1800
- additionalProperties: true,
1801
- $defs: {
1802
- OrganizationId: {
1803
- type: "string",
1804
- pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1805
- },
1806
- ContactId: {
1807
- type: "string",
1808
- pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
1809
- },
1810
- ContactGroupId: {
1811
- type: "string",
1812
- pattern: "^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$"
1813
- },
1814
- UnsubscribeId: {
1815
- type: "string",
1816
- pattern: "^unsub_[0-9a-hjkmnp-tv-z]{16,24}$"
1817
- },
1818
- MessageId: {
1819
- type: "string",
1820
- pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
1821
- },
1822
- CampaignId: {
1823
- type: "string",
1824
- pattern: "^camp_[0-9a-hjkmnp-tv-z]{16,24}$"
1825
- },
1826
- CampaignRunId: {
1827
- type: "string",
1828
- pattern: "^crun_[0-9a-hjkmnp-tv-z]{16,24}$"
1829
- }
1830
- }
1888
+ ],
1889
+ additionalProperties: true
1831
1890
  },
1832
1891
  "contact.resubscribed": {
1833
1892
  type: "object",
@@ -1840,13 +1899,25 @@ const WebhookEventJsonSchemas = {
1840
1899
  data: {
1841
1900
  type: "object",
1842
1901
  properties: {
1843
- organizationId: { $ref: "#/$defs/OrganizationId" },
1844
- contactId: { $ref: "#/$defs/ContactId" },
1902
+ organizationId: {
1903
+ type: "string",
1904
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1905
+ },
1906
+ contactId: {
1907
+ type: "string",
1908
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
1909
+ },
1845
1910
  email: { anyOf: [{ type: "string" }, { type: "null" }] },
1846
1911
  groupId: { type: "string" },
1847
1912
  groupName: { type: "string" },
1848
- contactGroupId: { anyOf: [{ $ref: "#/$defs/ContactGroupId" }, { type: "null" }] },
1849
- unsubscribeGroupId: { anyOf: [{ $ref: "#/$defs/UnsubscribeId" }, { type: "null" }] },
1913
+ contactGroupId: { anyOf: [{
1914
+ type: "string",
1915
+ pattern: "^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$"
1916
+ }, { type: "null" }] },
1917
+ unsubscribeGroupId: { anyOf: [{
1918
+ type: "string",
1919
+ pattern: "^unsub_[0-9a-hjkmnp-tv-z]{16,24}$"
1920
+ }, { type: "null" }] },
1850
1921
  consentIp: { anyOf: [{ type: "string" }, { type: "null" }] },
1851
1922
  consentSource: { anyOf: [{ type: "string" }, { type: "null" }] },
1852
1923
  source: {
@@ -1858,9 +1929,18 @@ const WebhookEventJsonSchemas = {
1858
1929
  "complaint"
1859
1930
  ]
1860
1931
  },
1861
- messageId: { anyOf: [{ $ref: "#/$defs/MessageId" }, { type: "null" }] },
1862
- campaignId: { anyOf: [{ $ref: "#/$defs/CampaignId" }, { type: "null" }] },
1863
- campaignRunId: { anyOf: [{ $ref: "#/$defs/CampaignRunId" }, { type: "null" }] },
1932
+ messageId: { anyOf: [{
1933
+ type: "string",
1934
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
1935
+ }, { type: "null" }] },
1936
+ campaignId: { anyOf: [{
1937
+ type: "string",
1938
+ pattern: "^camp_[0-9a-hjkmnp-tv-z]{16,24}$"
1939
+ }, { type: "null" }] },
1940
+ campaignRunId: { anyOf: [{
1941
+ type: "string",
1942
+ pattern: "^crun_[0-9a-hjkmnp-tv-z]{16,24}$"
1943
+ }, { type: "null" }] },
1864
1944
  occurredAt: { type: "string" }
1865
1945
  },
1866
1946
  required: [
@@ -1879,37 +1959,7 @@ const WebhookEventJsonSchemas = {
1879
1959
  "timestamp",
1880
1960
  "data"
1881
1961
  ],
1882
- additionalProperties: true,
1883
- $defs: {
1884
- OrganizationId: {
1885
- type: "string",
1886
- pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1887
- },
1888
- ContactId: {
1889
- type: "string",
1890
- pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
1891
- },
1892
- ContactGroupId: {
1893
- type: "string",
1894
- pattern: "^cgrp_[0-9a-hjkmnp-tv-z]{16,24}$"
1895
- },
1896
- UnsubscribeId: {
1897
- type: "string",
1898
- pattern: "^unsub_[0-9a-hjkmnp-tv-z]{16,24}$"
1899
- },
1900
- MessageId: {
1901
- type: "string",
1902
- pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
1903
- },
1904
- CampaignId: {
1905
- type: "string",
1906
- pattern: "^camp_[0-9a-hjkmnp-tv-z]{16,24}$"
1907
- },
1908
- CampaignRunId: {
1909
- type: "string",
1910
- pattern: "^crun_[0-9a-hjkmnp-tv-z]{16,24}$"
1911
- }
1912
- }
1962
+ additionalProperties: true
1913
1963
  },
1914
1964
  "contact.consent_changed": {
1915
1965
  type: "object",
@@ -1922,12 +1972,21 @@ const WebhookEventJsonSchemas = {
1922
1972
  data: {
1923
1973
  type: "object",
1924
1974
  properties: {
1925
- organizationId: { $ref: "#/$defs/OrganizationId" },
1926
- contactId: { $ref: "#/$defs/ContactId" },
1975
+ organizationId: {
1976
+ type: "string",
1977
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1978
+ },
1979
+ contactId: {
1980
+ type: "string",
1981
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
1982
+ },
1927
1983
  identity: {
1928
1984
  type: "object",
1929
1985
  properties: {
1930
- id: { $ref: "#/$defs/ContactIdentityId" },
1986
+ id: {
1987
+ type: "string",
1988
+ pattern: "^cident_[0-9a-hjkmnp-tv-z]{16,24}$"
1989
+ },
1931
1990
  type: {
1932
1991
  type: "string",
1933
1992
  enum: ["email", "phone"]
@@ -1978,21 +2037,7 @@ const WebhookEventJsonSchemas = {
1978
2037
  "timestamp",
1979
2038
  "data"
1980
2039
  ],
1981
- additionalProperties: true,
1982
- $defs: {
1983
- OrganizationId: {
1984
- type: "string",
1985
- pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
1986
- },
1987
- ContactId: {
1988
- type: "string",
1989
- pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
1990
- },
1991
- ContactIdentityId: {
1992
- type: "string",
1993
- pattern: "^cident_[0-9a-hjkmnp-tv-z]{16,24}$"
1994
- }
1995
- }
2040
+ additionalProperties: true
1996
2041
  },
1997
2042
  "conversation.created": {
1998
2043
  type: "object",
@@ -2005,8 +2050,14 @@ const WebhookEventJsonSchemas = {
2005
2050
  data: {
2006
2051
  type: "object",
2007
2052
  properties: {
2008
- conversationId: { $ref: "#/$defs/ConversationId" },
2009
- organizationId: { $ref: "#/$defs/OrganizationId" },
2053
+ conversationId: {
2054
+ type: "string",
2055
+ pattern: "^conv_[0-9a-hjkmnp-tv-z]{16,24}$"
2056
+ },
2057
+ organizationId: {
2058
+ type: "string",
2059
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2060
+ },
2010
2061
  title: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
2011
2062
  channels: {
2012
2063
  type: "array",
@@ -2037,7 +2088,10 @@ const WebhookEventJsonSchemas = {
2037
2088
  "archived"
2038
2089
  ]
2039
2090
  },
2040
- primaryContactId: { anyOf: [{ anyOf: [{ $ref: "#/$defs/ContactId" }, { type: "null" }] }, { type: "null" }] },
2091
+ primaryContactId: { anyOf: [{ anyOf: [{
2092
+ type: "string",
2093
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
2094
+ }, { type: "null" }] }, { type: "null" }] },
2041
2095
  createdAt: { type: "string" },
2042
2096
  updatedAt: { type: "string" }
2043
2097
  },
@@ -2058,21 +2112,7 @@ const WebhookEventJsonSchemas = {
2058
2112
  "timestamp",
2059
2113
  "data"
2060
2114
  ],
2061
- additionalProperties: true,
2062
- $defs: {
2063
- ConversationId: {
2064
- type: "string",
2065
- pattern: "^conv_[0-9a-hjkmnp-tv-z]{16,24}$"
2066
- },
2067
- OrganizationId: {
2068
- type: "string",
2069
- pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2070
- },
2071
- ContactId: {
2072
- type: "string",
2073
- pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
2074
- }
2075
- }
2115
+ additionalProperties: true
2076
2116
  },
2077
2117
  "conversation.updated": {
2078
2118
  type: "object",
@@ -2085,8 +2125,14 @@ const WebhookEventJsonSchemas = {
2085
2125
  data: {
2086
2126
  type: "object",
2087
2127
  properties: {
2088
- conversationId: { $ref: "#/$defs/ConversationId" },
2089
- organizationId: { $ref: "#/$defs/OrganizationId" },
2128
+ conversationId: {
2129
+ type: "string",
2130
+ pattern: "^conv_[0-9a-hjkmnp-tv-z]{16,24}$"
2131
+ },
2132
+ organizationId: {
2133
+ type: "string",
2134
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2135
+ },
2090
2136
  title: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
2091
2137
  channels: {
2092
2138
  type: "array",
@@ -2117,7 +2163,10 @@ const WebhookEventJsonSchemas = {
2117
2163
  "archived"
2118
2164
  ]
2119
2165
  },
2120
- primaryContactId: { anyOf: [{ anyOf: [{ $ref: "#/$defs/ContactId" }, { type: "null" }] }, { type: "null" }] },
2166
+ primaryContactId: { anyOf: [{ anyOf: [{
2167
+ type: "string",
2168
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
2169
+ }, { type: "null" }] }, { type: "null" }] },
2121
2170
  createdAt: { type: "string" },
2122
2171
  updatedAt: { type: "string" }
2123
2172
  },
@@ -2138,21 +2187,7 @@ const WebhookEventJsonSchemas = {
2138
2187
  "timestamp",
2139
2188
  "data"
2140
2189
  ],
2141
- additionalProperties: true,
2142
- $defs: {
2143
- ConversationId: {
2144
- type: "string",
2145
- pattern: "^conv_[0-9a-hjkmnp-tv-z]{16,24}$"
2146
- },
2147
- OrganizationId: {
2148
- type: "string",
2149
- pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2150
- },
2151
- ContactId: {
2152
- type: "string",
2153
- pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
2154
- }
2155
- }
2190
+ additionalProperties: true
2156
2191
  },
2157
2192
  "conversation.archived": {
2158
2193
  type: "object",
@@ -2165,8 +2200,14 @@ const WebhookEventJsonSchemas = {
2165
2200
  data: {
2166
2201
  type: "object",
2167
2202
  properties: {
2168
- conversationId: { $ref: "#/$defs/ConversationId" },
2169
- organizationId: { $ref: "#/$defs/OrganizationId" },
2203
+ conversationId: {
2204
+ type: "string",
2205
+ pattern: "^conv_[0-9a-hjkmnp-tv-z]{16,24}$"
2206
+ },
2207
+ organizationId: {
2208
+ type: "string",
2209
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2210
+ },
2170
2211
  title: { anyOf: [{ anyOf: [{ type: "string" }, { type: "null" }] }, { type: "null" }] },
2171
2212
  channels: {
2172
2213
  type: "array",
@@ -2197,7 +2238,10 @@ const WebhookEventJsonSchemas = {
2197
2238
  "archived"
2198
2239
  ]
2199
2240
  },
2200
- primaryContactId: { anyOf: [{ anyOf: [{ $ref: "#/$defs/ContactId" }, { type: "null" }] }, { type: "null" }] },
2241
+ primaryContactId: { anyOf: [{ anyOf: [{
2242
+ type: "string",
2243
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
2244
+ }, { type: "null" }] }, { type: "null" }] },
2201
2245
  createdAt: { type: "string" },
2202
2246
  updatedAt: { type: "string" }
2203
2247
  },
@@ -2218,21 +2262,7 @@ const WebhookEventJsonSchemas = {
2218
2262
  "timestamp",
2219
2263
  "data"
2220
2264
  ],
2221
- additionalProperties: true,
2222
- $defs: {
2223
- ConversationId: {
2224
- type: "string",
2225
- pattern: "^conv_[0-9a-hjkmnp-tv-z]{16,24}$"
2226
- },
2227
- OrganizationId: {
2228
- type: "string",
2229
- pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2230
- },
2231
- ContactId: {
2232
- type: "string",
2233
- pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
2234
- }
2235
- }
2265
+ additionalProperties: true
2236
2266
  },
2237
2267
  "webhook.created": {
2238
2268
  type: "object",
@@ -2245,8 +2275,14 @@ const WebhookEventJsonSchemas = {
2245
2275
  data: {
2246
2276
  type: "object",
2247
2277
  properties: {
2248
- webhookId: { $ref: "#/$defs/WebhookEndpointId" },
2249
- organizationId: { $ref: "#/$defs/OrganizationId" },
2278
+ webhookId: {
2279
+ type: "string",
2280
+ pattern: "^wep_[0-9a-hjkmnp-tv-z]{16,24}$"
2281
+ },
2282
+ organizationId: {
2283
+ type: "string",
2284
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2285
+ },
2250
2286
  name: { type: "string" },
2251
2287
  url: { type: "string" },
2252
2288
  eventTypes: {
@@ -2283,17 +2319,7 @@ const WebhookEventJsonSchemas = {
2283
2319
  "timestamp",
2284
2320
  "data"
2285
2321
  ],
2286
- additionalProperties: true,
2287
- $defs: {
2288
- WebhookEndpointId: {
2289
- type: "string",
2290
- pattern: "^wep_[0-9a-hjkmnp-tv-z]{16,24}$"
2291
- },
2292
- OrganizationId: {
2293
- type: "string",
2294
- pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2295
- }
2296
- }
2322
+ additionalProperties: true
2297
2323
  },
2298
2324
  "webhook.updated": {
2299
2325
  type: "object",
@@ -2306,8 +2332,14 @@ const WebhookEventJsonSchemas = {
2306
2332
  data: {
2307
2333
  type: "object",
2308
2334
  properties: {
2309
- webhookId: { $ref: "#/$defs/WebhookEndpointId" },
2310
- organizationId: { $ref: "#/$defs/OrganizationId" },
2335
+ webhookId: {
2336
+ type: "string",
2337
+ pattern: "^wep_[0-9a-hjkmnp-tv-z]{16,24}$"
2338
+ },
2339
+ organizationId: {
2340
+ type: "string",
2341
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2342
+ },
2311
2343
  name: { type: "string" },
2312
2344
  url: { type: "string" },
2313
2345
  eventTypes: {
@@ -2344,17 +2376,7 @@ const WebhookEventJsonSchemas = {
2344
2376
  "timestamp",
2345
2377
  "data"
2346
2378
  ],
2347
- additionalProperties: true,
2348
- $defs: {
2349
- WebhookEndpointId: {
2350
- type: "string",
2351
- pattern: "^wep_[0-9a-hjkmnp-tv-z]{16,24}$"
2352
- },
2353
- OrganizationId: {
2354
- type: "string",
2355
- pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2356
- }
2357
- }
2379
+ additionalProperties: true
2358
2380
  },
2359
2381
  "webhook.deleted": {
2360
2382
  type: "object",
@@ -2367,8 +2389,14 @@ const WebhookEventJsonSchemas = {
2367
2389
  data: {
2368
2390
  type: "object",
2369
2391
  properties: {
2370
- webhookId: { $ref: "#/$defs/WebhookEndpointId" },
2371
- organizationId: { $ref: "#/$defs/OrganizationId" },
2392
+ webhookId: {
2393
+ type: "string",
2394
+ pattern: "^wep_[0-9a-hjkmnp-tv-z]{16,24}$"
2395
+ },
2396
+ organizationId: {
2397
+ type: "string",
2398
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2399
+ },
2372
2400
  name: { type: "string" },
2373
2401
  url: { type: "string" },
2374
2402
  eventTypes: {
@@ -2405,17 +2433,7 @@ const WebhookEventJsonSchemas = {
2405
2433
  "timestamp",
2406
2434
  "data"
2407
2435
  ],
2408
- additionalProperties: true,
2409
- $defs: {
2410
- WebhookEndpointId: {
2411
- type: "string",
2412
- pattern: "^wep_[0-9a-hjkmnp-tv-z]{16,24}$"
2413
- },
2414
- OrganizationId: {
2415
- type: "string",
2416
- pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2417
- }
2418
- }
2436
+ additionalProperties: true
2419
2437
  },
2420
2438
  "webhook.test": {
2421
2439
  type: "object",
@@ -2432,8 +2450,7 @@ const WebhookEventJsonSchemas = {
2432
2450
  "timestamp",
2433
2451
  "data"
2434
2452
  ],
2435
- additionalProperties: true,
2436
- $defs: {}
2453
+ additionalProperties: true
2437
2454
  },
2438
2455
  "domain.updated": {
2439
2456
  type: "object",
@@ -2446,8 +2463,14 @@ const WebhookEventJsonSchemas = {
2446
2463
  data: {
2447
2464
  type: "object",
2448
2465
  properties: {
2449
- domainId: { $ref: "#/$defs/EmailDomainId" },
2450
- organizationId: { $ref: "#/$defs/OrganizationId" },
2466
+ domainId: {
2467
+ type: "string",
2468
+ pattern: "^dom_[0-9a-hjkmnp-tv-z]{16,24}$"
2469
+ },
2470
+ organizationId: {
2471
+ type: "string",
2472
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2473
+ },
2451
2474
  domain: { type: "string" },
2452
2475
  previousPhase: {
2453
2476
  type: "string",
@@ -2525,7 +2548,10 @@ const WebhookEventJsonSchemas = {
2525
2548
  required: ["identity"],
2526
2549
  additionalProperties: true
2527
2550
  }, { type: "null" }] },
2528
- operationId: { anyOf: [{ $ref: "#/$defs/OperationId" }, { type: "null" }] },
2551
+ operationId: { anyOf: [{
2552
+ type: "string",
2553
+ pattern: "^op_[0-9a-hjkmnp-tv-z]{16,24}$"
2554
+ }, { type: "null" }] },
2529
2555
  checkedAt: { anyOf: [{ type: "string" }, { type: "null" }] },
2530
2556
  nextCheckAt: { anyOf: [{ type: "string" }, { type: "null" }] },
2531
2557
  failure: { anyOf: [{
@@ -2566,21 +2592,7 @@ const WebhookEventJsonSchemas = {
2566
2592
  "timestamp",
2567
2593
  "data"
2568
2594
  ],
2569
- additionalProperties: true,
2570
- $defs: {
2571
- EmailDomainId: {
2572
- type: "string",
2573
- pattern: "^dom_[0-9a-hjkmnp-tv-z]{16,24}$"
2574
- },
2575
- OrganizationId: {
2576
- type: "string",
2577
- pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2578
- },
2579
- OperationId: {
2580
- type: "string",
2581
- pattern: "^op_[0-9a-hjkmnp-tv-z]{16,24}$"
2582
- }
2583
- }
2595
+ additionalProperties: true
2584
2596
  },
2585
2597
  "domain.warming.updated": {
2586
2598
  type: "object",
@@ -2662,8 +2674,7 @@ const WebhookEventJsonSchemas = {
2662
2674
  "timestamp",
2663
2675
  "data"
2664
2676
  ],
2665
- additionalProperties: true,
2666
- $defs: {}
2677
+ additionalProperties: true
2667
2678
  },
2668
2679
  "template.registration.updated": {
2669
2680
  type: "object",
@@ -2676,10 +2687,46 @@ const WebhookEventJsonSchemas = {
2676
2687
  data: {
2677
2688
  type: "object",
2678
2689
  properties: {
2679
- id: { $ref: "#/$defs/TemplateRegistrationId" },
2680
- templateId: { $ref: "#/$defs/TemplateId" },
2681
- publicationId: { $ref: "#/$defs/TemplatePublicationId" },
2682
- target: { $ref: "#/$defs/TemplateRegistrationTarget" },
2690
+ id: {
2691
+ type: "string",
2692
+ pattern: "^treg_[0-9a-hjkmnp-tv-z]{16,24}$"
2693
+ },
2694
+ templateId: {
2695
+ type: "string",
2696
+ pattern: "^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$"
2697
+ },
2698
+ publicationId: {
2699
+ type: "string",
2700
+ pattern: "^tpub_[0-9a-hjkmnp-tv-z]{16,24}$"
2701
+ },
2702
+ target: { anyOf: [{
2703
+ type: "object",
2704
+ properties: {
2705
+ provider: {
2706
+ type: "string",
2707
+ enum: ["whatsapp"]
2708
+ },
2709
+ wabaId: { type: "string" }
2710
+ },
2711
+ required: ["provider", "wabaId"],
2712
+ additionalProperties: true
2713
+ }, {
2714
+ type: "object",
2715
+ properties: {
2716
+ provider: {
2717
+ type: "string",
2718
+ enum: ["dlt"]
2719
+ },
2720
+ entityId: { type: "string" },
2721
+ headerId: { type: "string" }
2722
+ },
2723
+ required: [
2724
+ "provider",
2725
+ "entityId",
2726
+ "headerId"
2727
+ ],
2728
+ additionalProperties: true
2729
+ }] },
2683
2730
  name: { type: "string" },
2684
2731
  language: { type: "string" },
2685
2732
  status: {
@@ -2723,7 +2770,10 @@ const WebhookEventJsonSchemas = {
2723
2770
  statusChangedAt: { type: "string" },
2724
2771
  createdAt: { type: "string" },
2725
2772
  updatedAt: { type: "string" },
2726
- organizationId: { $ref: "#/$defs/OrganizationId" },
2773
+ organizationId: {
2774
+ type: "string",
2775
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2776
+ },
2727
2777
  previousStatus: {
2728
2778
  type: "string",
2729
2779
  enum: [
@@ -2763,55 +2813,7 @@ const WebhookEventJsonSchemas = {
2763
2813
  "timestamp",
2764
2814
  "data"
2765
2815
  ],
2766
- additionalProperties: true,
2767
- $defs: {
2768
- TemplateRegistrationId: {
2769
- type: "string",
2770
- pattern: "^treg_[0-9a-hjkmnp-tv-z]{16,24}$"
2771
- },
2772
- TemplateId: {
2773
- type: "string",
2774
- pattern: "^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$"
2775
- },
2776
- TemplatePublicationId: {
2777
- type: "string",
2778
- pattern: "^tpub_[0-9a-hjkmnp-tv-z]{16,24}$"
2779
- },
2780
- WhatsAppRegistrationTarget: {
2781
- type: "object",
2782
- properties: {
2783
- provider: {
2784
- type: "string",
2785
- enum: ["whatsapp"]
2786
- },
2787
- wabaId: { type: "string" }
2788
- },
2789
- required: ["provider", "wabaId"],
2790
- additionalProperties: true
2791
- },
2792
- DltRegistrationTarget: {
2793
- type: "object",
2794
- properties: {
2795
- provider: {
2796
- type: "string",
2797
- enum: ["dlt"]
2798
- },
2799
- entityId: { type: "string" },
2800
- headerId: { type: "string" }
2801
- },
2802
- required: [
2803
- "provider",
2804
- "entityId",
2805
- "headerId"
2806
- ],
2807
- additionalProperties: true
2808
- },
2809
- TemplateRegistrationTarget: { anyOf: [{ $ref: "#/$defs/WhatsAppRegistrationTarget" }, { $ref: "#/$defs/DltRegistrationTarget" }] },
2810
- OrganizationId: {
2811
- type: "string",
2812
- pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2813
- }
2814
- }
2816
+ additionalProperties: true
2815
2817
  },
2816
2818
  "flow.registration.updated": {
2817
2819
  type: "object",
@@ -2824,9 +2826,18 @@ const WebhookEventJsonSchemas = {
2824
2826
  data: {
2825
2827
  type: "object",
2826
2828
  properties: {
2827
- id: { $ref: "#/$defs/WhatsAppFlowRegistrationId" },
2828
- flowId: { $ref: "#/$defs/WhatsAppFlowId" },
2829
- versionId: { $ref: "#/$defs/WhatsAppFlowVersionId" },
2829
+ id: {
2830
+ type: "string",
2831
+ pattern: "^wafreg_[0-9a-hjkmnp-tv-z]{16,24}$"
2832
+ },
2833
+ flowId: {
2834
+ type: "string",
2835
+ pattern: "^waflow_[0-9a-hjkmnp-tv-z]{16,24}$"
2836
+ },
2837
+ versionId: {
2838
+ type: "string",
2839
+ pattern: "^wafver_[0-9a-hjkmnp-tv-z]{16,24}$"
2840
+ },
2830
2841
  versionNumber: { type: "integer" },
2831
2842
  wabaId: { type: "string" },
2832
2843
  providerFlowId: { anyOf: [{ type: "string" }, { type: "null" }] },
@@ -2843,13 +2854,48 @@ const WebhookEventJsonSchemas = {
2843
2854
  },
2844
2855
  validationErrors: {
2845
2856
  type: "array",
2846
- items: { $ref: "#/$defs/WhatsAppFlowValidationError" }
2857
+ items: {
2858
+ type: "object",
2859
+ properties: {
2860
+ error: { type: "string" },
2861
+ message: { type: "string" },
2862
+ path: { type: "string" },
2863
+ line: { type: "integer" },
2864
+ column: { type: "integer" }
2865
+ },
2866
+ required: ["error", "message"],
2867
+ additionalProperties: true
2868
+ }
2869
+ },
2870
+ endpointAlerts: {
2871
+ type: "array",
2872
+ items: {
2873
+ type: "object",
2874
+ properties: {
2875
+ kind: { type: "string" },
2876
+ message: { type: "string" },
2877
+ value: { anyOf: [{ type: "number" }, { type: "null" }] },
2878
+ threshold: { anyOf: [{ type: "number" }, { type: "null" }] },
2879
+ activatedAt: { type: "string" }
2880
+ },
2881
+ required: [
2882
+ "kind",
2883
+ "message",
2884
+ "value",
2885
+ "threshold",
2886
+ "activatedAt"
2887
+ ],
2888
+ additionalProperties: true
2889
+ }
2847
2890
  },
2848
2891
  publishedAt: { anyOf: [{ type: "string" }, { type: "null" }] },
2849
2892
  statusChangedAt: { type: "string" },
2850
2893
  createdAt: { type: "string" },
2851
2894
  updatedAt: { type: "string" },
2852
- organizationId: { $ref: "#/$defs/OrganizationId" },
2895
+ organizationId: {
2896
+ type: "string",
2897
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2898
+ },
2853
2899
  previousStatus: { anyOf: [{
2854
2900
  type: "string",
2855
2901
  enum: [
@@ -2871,6 +2917,7 @@ const WebhookEventJsonSchemas = {
2871
2917
  "name",
2872
2918
  "status",
2873
2919
  "validationErrors",
2920
+ "endpointAlerts",
2874
2921
  "publishedAt",
2875
2922
  "statusChangedAt",
2876
2923
  "createdAt",
@@ -2886,37 +2933,82 @@ const WebhookEventJsonSchemas = {
2886
2933
  "timestamp",
2887
2934
  "data"
2888
2935
  ],
2889
- additionalProperties: true,
2890
- $defs: {
2891
- WhatsAppFlowRegistrationId: {
2892
- type: "string",
2893
- pattern: "^wafreg_[0-9a-hjkmnp-tv-z]{16,24}$"
2894
- },
2895
- WhatsAppFlowId: {
2896
- type: "string",
2897
- pattern: "^waflow_[0-9a-hjkmnp-tv-z]{16,24}$"
2898
- },
2899
- WhatsAppFlowVersionId: {
2936
+ additionalProperties: true
2937
+ },
2938
+ "whatsapp.number.connected": {
2939
+ type: "object",
2940
+ properties: {
2941
+ type: {
2900
2942
  type: "string",
2901
- pattern: "^wafver_[0-9a-hjkmnp-tv-z]{16,24}$"
2943
+ enum: ["whatsapp.number.connected"]
2902
2944
  },
2903
- WhatsAppFlowValidationError: {
2945
+ timestamp: { type: "string" },
2946
+ data: {
2904
2947
  type: "object",
2905
2948
  properties: {
2906
- error: { type: "string" },
2907
- message: { type: "string" },
2908
- path: { type: "string" },
2909
- line: { type: "integer" },
2910
- column: { type: "integer" }
2949
+ organizationId: {
2950
+ type: "string",
2951
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2952
+ },
2953
+ namespaceId: { anyOf: [{
2954
+ type: "string",
2955
+ pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
2956
+ }, { type: "null" }] },
2957
+ businessAccountId: {
2958
+ type: "string",
2959
+ pattern: "^waba_[0-9a-hjkmnp-tv-z]{16,24}$"
2960
+ },
2961
+ phoneNumber: { type: "string" },
2962
+ phoneNumberId: { type: "string" },
2963
+ whatsappBusinessAccountId: { type: "string" },
2964
+ displayName: { type: "string" },
2965
+ verificationStatus: {
2966
+ type: "string",
2967
+ enum: [
2968
+ "pending",
2969
+ "verified",
2970
+ "failed",
2971
+ "suspended"
2972
+ ]
2973
+ },
2974
+ reconnected: { type: "boolean" },
2975
+ setupLink: { anyOf: [{
2976
+ type: "object",
2977
+ properties: {
2978
+ id: {
2979
+ type: "string",
2980
+ pattern: "^wasl_[0-9a-hjkmnp-tv-z]{16,24}$"
2981
+ },
2982
+ metadata: {
2983
+ type: "object",
2984
+ additionalProperties: true
2985
+ }
2986
+ },
2987
+ required: ["id", "metadata"],
2988
+ additionalProperties: true
2989
+ }, { type: "null" }] }
2911
2990
  },
2912
- required: ["error", "message"],
2991
+ required: [
2992
+ "organizationId",
2993
+ "namespaceId",
2994
+ "businessAccountId",
2995
+ "phoneNumber",
2996
+ "phoneNumberId",
2997
+ "whatsappBusinessAccountId",
2998
+ "displayName",
2999
+ "verificationStatus",
3000
+ "reconnected",
3001
+ "setupLink"
3002
+ ],
2913
3003
  additionalProperties: true
2914
- },
2915
- OrganizationId: {
2916
- type: "string",
2917
- pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
2918
3004
  }
2919
- }
3005
+ },
3006
+ required: [
3007
+ "type",
3008
+ "timestamp",
3009
+ "data"
3010
+ ],
3011
+ additionalProperties: true
2920
3012
  },
2921
3013
  "mailbox.message.received": {
2922
3014
  type: "object",
@@ -2929,14 +3021,34 @@ const WebhookEventJsonSchemas = {
2929
3021
  data: {
2930
3022
  type: "object",
2931
3023
  properties: {
2932
- mailboxId: { $ref: "#/$defs/MailboxId" },
2933
- namespaceId: { anyOf: [{ $ref: "#/$defs/NamespaceId" }, { type: "null" }] },
3024
+ mailboxId: {
3025
+ type: "string",
3026
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
3027
+ },
3028
+ namespaceId: { anyOf: [{
3029
+ type: "string",
3030
+ pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
3031
+ }, { type: "null" }] },
2934
3032
  message: {
2935
3033
  type: "object",
2936
3034
  properties: {
2937
- id: { $ref: "#/$defs/MessageId" },
2938
- channel: { $ref: "#/$defs/MailboxChannel" },
2939
- threadId: { $ref: "#/$defs/MailboxThreadId" },
3035
+ id: {
3036
+ type: "string",
3037
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
3038
+ },
3039
+ channel: {
3040
+ type: "string",
3041
+ enum: [
3042
+ "email",
3043
+ "whatsapp",
3044
+ "sms"
3045
+ ],
3046
+ description: "Deliveries recorded before this field existed omit it; they are email."
3047
+ },
3048
+ threadId: {
3049
+ type: "string",
3050
+ pattern: "^thread_[0-9a-hjkmnp-tv-z]{16,24}$"
3051
+ },
2940
3052
  from: {
2941
3053
  type: "object",
2942
3054
  properties: {
@@ -2962,7 +3074,10 @@ const WebhookEventJsonSchemas = {
2962
3074
  items: {
2963
3075
  type: "object",
2964
3076
  properties: {
2965
- id: { $ref: "#/$defs/AttachmentId" },
3077
+ id: {
3078
+ type: "string",
3079
+ pattern: "^att_[0-9a-hjkmnp-tv-z]{16,24}$"
3080
+ },
2966
3081
  filename: { type: "string" },
2967
3082
  contentType: { type: "string" },
2968
3083
  size: { type: "number" }
@@ -2995,9 +3110,15 @@ const WebhookEventJsonSchemas = {
2995
3110
  thread: {
2996
3111
  type: "object",
2997
3112
  properties: {
2998
- id: { $ref: "#/$defs/MailboxThreadId" },
3113
+ id: {
3114
+ type: "string",
3115
+ pattern: "^thread_[0-9a-hjkmnp-tv-z]{16,24}$"
3116
+ },
2999
3117
  endpointId: {
3000
- anyOf: [{ $ref: "#/$defs/MailboxEndpointId" }, { type: "null" }],
3118
+ anyOf: [{
3119
+ type: "string",
3120
+ pattern: "^mbxep_[0-9a-hjkmnp-tv-z]{16,24}$"
3121
+ }, { type: "null" }],
3001
3122
  description: "The endpoint the message arrived at; null once it is removed. Deliveries recorded before this field existed omit it."
3002
3123
  },
3003
3124
  subject: { anyOf: [{ type: "string" }, { type: "null" }] },
@@ -3025,42 +3146,7 @@ const WebhookEventJsonSchemas = {
3025
3146
  "timestamp",
3026
3147
  "data"
3027
3148
  ],
3028
- additionalProperties: true,
3029
- $defs: {
3030
- MailboxId: {
3031
- type: "string",
3032
- pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
3033
- },
3034
- NamespaceId: {
3035
- type: "string",
3036
- pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
3037
- },
3038
- MessageId: {
3039
- type: "string",
3040
- pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
3041
- },
3042
- MailboxChannel: {
3043
- type: "string",
3044
- enum: [
3045
- "email",
3046
- "whatsapp",
3047
- "sms"
3048
- ],
3049
- description: "Deliveries recorded before this field existed omit it; they are email."
3050
- },
3051
- MailboxThreadId: {
3052
- type: "string",
3053
- pattern: "^thread_[0-9a-hjkmnp-tv-z]{16,24}$"
3054
- },
3055
- AttachmentId: {
3056
- type: "string",
3057
- pattern: "^att_[0-9a-hjkmnp-tv-z]{16,24}$"
3058
- },
3059
- MailboxEndpointId: {
3060
- type: "string",
3061
- pattern: "^mbxep_[0-9a-hjkmnp-tv-z]{16,24}$"
3062
- }
3063
- }
3149
+ additionalProperties: true
3064
3150
  },
3065
3151
  "mailbox.message.sent": {
3066
3152
  type: "object",
@@ -3073,9 +3159,18 @@ const WebhookEventJsonSchemas = {
3073
3159
  data: {
3074
3160
  type: "object",
3075
3161
  properties: {
3076
- mailboxId: { $ref: "#/$defs/MailboxId" },
3077
- namespaceId: { anyOf: [{ $ref: "#/$defs/NamespaceId" }, { type: "null" }] },
3078
- actionId: { $ref: "#/$defs/MailboxActionId" },
3162
+ mailboxId: {
3163
+ type: "string",
3164
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
3165
+ },
3166
+ namespaceId: { anyOf: [{
3167
+ type: "string",
3168
+ pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
3169
+ }, { type: "null" }] },
3170
+ actionId: {
3171
+ type: "string",
3172
+ pattern: "^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$"
3173
+ },
3079
3174
  state: {
3080
3175
  type: "string",
3081
3176
  enum: ["completed"],
@@ -3119,9 +3214,23 @@ const WebhookEventJsonSchemas = {
3119
3214
  message: {
3120
3215
  type: "object",
3121
3216
  properties: {
3122
- id: { $ref: "#/$defs/MessageId" },
3123
- channel: { $ref: "#/$defs/MailboxChannel" },
3124
- threadId: { $ref: "#/$defs/MailboxThreadId" },
3217
+ id: {
3218
+ type: "string",
3219
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
3220
+ },
3221
+ channel: {
3222
+ type: "string",
3223
+ enum: [
3224
+ "email",
3225
+ "whatsapp",
3226
+ "sms"
3227
+ ],
3228
+ description: "Deliveries recorded before this field existed omit it; they are email."
3229
+ },
3230
+ threadId: {
3231
+ type: "string",
3232
+ pattern: "^thread_[0-9a-hjkmnp-tv-z]{16,24}$"
3233
+ },
3125
3234
  from: {
3126
3235
  type: "object",
3127
3236
  properties: {
@@ -3147,7 +3256,10 @@ const WebhookEventJsonSchemas = {
3147
3256
  items: {
3148
3257
  type: "object",
3149
3258
  properties: {
3150
- id: { $ref: "#/$defs/AttachmentId" },
3259
+ id: {
3260
+ type: "string",
3261
+ pattern: "^att_[0-9a-hjkmnp-tv-z]{16,24}$"
3262
+ },
3151
3263
  filename: { type: "string" },
3152
3264
  contentType: { type: "string" },
3153
3265
  size: { type: "number" }
@@ -3193,42 +3305,7 @@ const WebhookEventJsonSchemas = {
3193
3305
  "timestamp",
3194
3306
  "data"
3195
3307
  ],
3196
- additionalProperties: true,
3197
- $defs: {
3198
- MailboxId: {
3199
- type: "string",
3200
- pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
3201
- },
3202
- NamespaceId: {
3203
- type: "string",
3204
- pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
3205
- },
3206
- MailboxActionId: {
3207
- type: "string",
3208
- pattern: "^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$"
3209
- },
3210
- MessageId: {
3211
- type: "string",
3212
- pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
3213
- },
3214
- MailboxChannel: {
3215
- type: "string",
3216
- enum: [
3217
- "email",
3218
- "whatsapp",
3219
- "sms"
3220
- ],
3221
- description: "Deliveries recorded before this field existed omit it; they are email."
3222
- },
3223
- MailboxThreadId: {
3224
- type: "string",
3225
- pattern: "^thread_[0-9a-hjkmnp-tv-z]{16,24}$"
3226
- },
3227
- AttachmentId: {
3228
- type: "string",
3229
- pattern: "^att_[0-9a-hjkmnp-tv-z]{16,24}$"
3230
- }
3231
- }
3308
+ additionalProperties: true
3232
3309
  },
3233
3310
  "mailbox.action.pending_approval": {
3234
3311
  type: "object",
@@ -3241,12 +3318,21 @@ const WebhookEventJsonSchemas = {
3241
3318
  data: {
3242
3319
  type: "object",
3243
3320
  properties: {
3244
- mailboxId: { $ref: "#/$defs/MailboxId" },
3245
- namespaceId: { anyOf: [{ $ref: "#/$defs/NamespaceId" }, { type: "null" }] },
3321
+ mailboxId: {
3322
+ type: "string",
3323
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
3324
+ },
3325
+ namespaceId: { anyOf: [{
3326
+ type: "string",
3327
+ pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
3328
+ }, { type: "null" }] },
3246
3329
  action: {
3247
3330
  type: "object",
3248
3331
  properties: {
3249
- id: { $ref: "#/$defs/MailboxActionId" },
3332
+ id: {
3333
+ type: "string",
3334
+ pattern: "^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$"
3335
+ },
3250
3336
  type: {
3251
3337
  type: "string",
3252
3338
  enum: [
@@ -3265,8 +3351,46 @@ const WebhookEventJsonSchemas = {
3265
3351
  enum: ["approvalRequired"],
3266
3352
  description: "Deliveries recorded before this field existed omit it."
3267
3353
  },
3268
- decision: { $ref: "#/$defs/MailboxActionDecision" },
3269
- threadId: { anyOf: [{ $ref: "#/$defs/MailboxThreadId" }, { type: "null" }] },
3354
+ decision: {
3355
+ type: "object",
3356
+ properties: {
3357
+ outcome: {
3358
+ type: "string",
3359
+ enum: [
3360
+ "allow",
3361
+ "requireApproval",
3362
+ "deny"
3363
+ ]
3364
+ },
3365
+ reason: { anyOf: [{ type: "string" }, { type: "null" }] },
3366
+ policyId: { anyOf: [{
3367
+ type: "string",
3368
+ pattern: "^mbxpol_[0-9a-hjkmnp-tv-z]{16,24}$"
3369
+ }, { type: "null" }] },
3370
+ source: { anyOf: [{
3371
+ type: "string",
3372
+ enum: [
3373
+ "grant",
3374
+ "installation",
3375
+ "policy"
3376
+ ]
3377
+ }, { type: "null" }] },
3378
+ decidedAt: { type: "string" }
3379
+ },
3380
+ required: [
3381
+ "outcome",
3382
+ "reason",
3383
+ "policyId",
3384
+ "source",
3385
+ "decidedAt"
3386
+ ],
3387
+ additionalProperties: true,
3388
+ description: "Deliveries recorded before this field existed omit it."
3389
+ },
3390
+ threadId: { anyOf: [{
3391
+ type: "string",
3392
+ pattern: "^thread_[0-9a-hjkmnp-tv-z]{16,24}$"
3393
+ }, { type: "null" }] },
3270
3394
  reason: { anyOf: [{ type: "string" }, { type: "null" }] },
3271
3395
  proposedBy: {
3272
3396
  type: "object",
@@ -3349,62 +3473,7 @@ const WebhookEventJsonSchemas = {
3349
3473
  "timestamp",
3350
3474
  "data"
3351
3475
  ],
3352
- additionalProperties: true,
3353
- $defs: {
3354
- MailboxId: {
3355
- type: "string",
3356
- pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
3357
- },
3358
- NamespaceId: {
3359
- type: "string",
3360
- pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
3361
- },
3362
- MailboxActionId: {
3363
- type: "string",
3364
- pattern: "^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$"
3365
- },
3366
- MailboxPolicyId: {
3367
- type: "string",
3368
- pattern: "^mbxpol_[0-9a-hjkmnp-tv-z]{16,24}$"
3369
- },
3370
- MailboxActionDecision: {
3371
- type: "object",
3372
- properties: {
3373
- outcome: {
3374
- type: "string",
3375
- enum: [
3376
- "allow",
3377
- "requireApproval",
3378
- "deny"
3379
- ]
3380
- },
3381
- reason: { anyOf: [{ type: "string" }, { type: "null" }] },
3382
- policyId: { anyOf: [{ $ref: "#/$defs/MailboxPolicyId" }, { type: "null" }] },
3383
- source: { anyOf: [{
3384
- type: "string",
3385
- enum: [
3386
- "grant",
3387
- "installation",
3388
- "policy"
3389
- ]
3390
- }, { type: "null" }] },
3391
- decidedAt: { type: "string" }
3392
- },
3393
- required: [
3394
- "outcome",
3395
- "reason",
3396
- "policyId",
3397
- "source",
3398
- "decidedAt"
3399
- ],
3400
- additionalProperties: true,
3401
- description: "Deliveries recorded before this field existed omit it."
3402
- },
3403
- MailboxThreadId: {
3404
- type: "string",
3405
- pattern: "^thread_[0-9a-hjkmnp-tv-z]{16,24}$"
3406
- }
3407
- }
3476
+ additionalProperties: true
3408
3477
  },
3409
3478
  "mailbox.action.resolved": {
3410
3479
  type: "object",
@@ -3417,12 +3486,21 @@ const WebhookEventJsonSchemas = {
3417
3486
  data: {
3418
3487
  type: "object",
3419
3488
  properties: {
3420
- mailboxId: { $ref: "#/$defs/MailboxId" },
3421
- namespaceId: { anyOf: [{ $ref: "#/$defs/NamespaceId" }, { type: "null" }] },
3489
+ mailboxId: {
3490
+ type: "string",
3491
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
3492
+ },
3493
+ namespaceId: { anyOf: [{
3494
+ type: "string",
3495
+ pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
3496
+ }, { type: "null" }] },
3422
3497
  action: {
3423
3498
  type: "object",
3424
3499
  properties: {
3425
- id: { $ref: "#/$defs/MailboxActionId" },
3500
+ id: {
3501
+ type: "string",
3502
+ pattern: "^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$"
3503
+ },
3426
3504
  type: {
3427
3505
  type: "string",
3428
3506
  enum: [
@@ -3436,7 +3514,10 @@ const WebhookEventJsonSchemas = {
3436
3514
  "extensionRequest"
3437
3515
  ]
3438
3516
  },
3439
- threadId: { anyOf: [{ $ref: "#/$defs/MailboxThreadId" }, { type: "null" }] },
3517
+ threadId: { anyOf: [{
3518
+ type: "string",
3519
+ pattern: "^thread_[0-9a-hjkmnp-tv-z]{16,24}$"
3520
+ }, { type: "null" }] },
3440
3521
  proposedBy: {
3441
3522
  type: "object",
3442
3523
  properties: {
@@ -3482,102 +3563,83 @@ const WebhookEventJsonSchemas = {
3482
3563
  ],
3483
3564
  additionalProperties: true
3484
3565
  },
3485
- resolution: { $ref: "#/$defs/MailboxActionResolution" }
3486
- },
3487
- required: [
3488
- "mailboxId",
3489
- "namespaceId",
3490
- "action",
3491
- "resolution"
3492
- ],
3493
- additionalProperties: true
3494
- }
3495
- },
3496
- required: [
3497
- "type",
3498
- "timestamp",
3499
- "data"
3500
- ],
3501
- additionalProperties: true,
3502
- $defs: {
3503
- MailboxId: {
3504
- type: "string",
3505
- pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
3506
- },
3507
- NamespaceId: {
3508
- type: "string",
3509
- pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
3510
- },
3511
- MailboxActionId: {
3512
- type: "string",
3513
- pattern: "^mbxact_[0-9a-hjkmnp-tv-z]{16,24}$"
3514
- },
3515
- MailboxThreadId: {
3516
- type: "string",
3517
- pattern: "^thread_[0-9a-hjkmnp-tv-z]{16,24}$"
3518
- },
3519
- MailboxActionResolution: {
3520
- type: "object",
3521
- properties: {
3522
- outcome: {
3523
- type: "string",
3524
- enum: [
3525
- "approved",
3526
- "denied",
3527
- "cancelled"
3528
- ]
3529
- },
3530
- actor: {
3566
+ resolution: {
3531
3567
  type: "object",
3532
3568
  properties: {
3533
- kind: {
3569
+ outcome: {
3534
3570
  type: "string",
3535
3571
  enum: [
3536
- "user",
3537
- "apiKey",
3538
- "extension",
3539
- "externalAgent",
3540
- "samvaAgent",
3541
- "system"
3572
+ "approved",
3573
+ "denied",
3574
+ "cancelled"
3542
3575
  ]
3543
3576
  },
3544
- id: { type: "string" },
3545
- displayName: { anyOf: [{ type: "string" }, { type: "null" }] },
3546
- source: {
3547
- type: "string",
3548
- enum: [
3549
- "humanUi",
3550
- "externalApi",
3551
- "externalAgent",
3552
- "extension",
3553
- "system"
3554
- ]
3577
+ actor: {
3578
+ type: "object",
3579
+ properties: {
3580
+ kind: {
3581
+ type: "string",
3582
+ enum: [
3583
+ "user",
3584
+ "apiKey",
3585
+ "extension",
3586
+ "externalAgent",
3587
+ "samvaAgent",
3588
+ "system"
3589
+ ]
3590
+ },
3591
+ id: { type: "string" },
3592
+ displayName: { anyOf: [{ type: "string" }, { type: "null" }] },
3593
+ source: {
3594
+ type: "string",
3595
+ enum: [
3596
+ "humanUi",
3597
+ "externalApi",
3598
+ "externalAgent",
3599
+ "extension",
3600
+ "system"
3601
+ ]
3602
+ }
3603
+ },
3604
+ required: [
3605
+ "kind",
3606
+ "id",
3607
+ "source"
3608
+ ],
3609
+ additionalProperties: true,
3610
+ description: "Who resolved the approval."
3611
+ },
3612
+ resolvedAt: { type: "string" },
3613
+ reason: {
3614
+ anyOf: [{ type: "string" }, { type: "null" }],
3615
+ description: "The denial reason; null for an approval or a cancellation."
3555
3616
  }
3556
3617
  },
3557
3618
  required: [
3558
- "kind",
3559
- "id",
3560
- "source"
3619
+ "outcome",
3620
+ "actor",
3621
+ "resolvedAt",
3622
+ "reason"
3561
3623
  ],
3562
3624
  additionalProperties: true,
3563
- description: "Who resolved the approval."
3564
- },
3565
- resolvedAt: { type: "string" },
3566
- reason: {
3567
- anyOf: [{ type: "string" }, { type: "null" }],
3568
- description: "The denial reason; null for an approval or a cancellation."
3625
+ description: "How the action's approval ended."
3569
3626
  }
3570
3627
  },
3571
3628
  required: [
3572
- "outcome",
3573
- "actor",
3574
- "resolvedAt",
3575
- "reason"
3629
+ "mailboxId",
3630
+ "namespaceId",
3631
+ "action",
3632
+ "resolution"
3576
3633
  ],
3577
- additionalProperties: true,
3578
- description: "How the action's approval ended."
3634
+ additionalProperties: true
3579
3635
  }
3580
- }
3636
+ },
3637
+ required: [
3638
+ "type",
3639
+ "timestamp",
3640
+ "data"
3641
+ ],
3642
+ additionalProperties: true
3581
3643
  },
3582
3644
  "mailbox.message.quarantined": {
3583
3645
  type: "object",
@@ -3590,8 +3652,14 @@ const WebhookEventJsonSchemas = {
3590
3652
  data: {
3591
3653
  type: "object",
3592
3654
  properties: {
3593
- mailboxId: { $ref: "#/$defs/MailboxId" },
3594
- namespaceId: { anyOf: [{ $ref: "#/$defs/NamespaceId" }, { type: "null" }] },
3655
+ mailboxId: {
3656
+ type: "string",
3657
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
3658
+ },
3659
+ namespaceId: { anyOf: [{
3660
+ type: "string",
3661
+ pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
3662
+ }, { type: "null" }] },
3595
3663
  disposition: {
3596
3664
  type: "string",
3597
3665
  enum: ["quarantined", "isolated"]
@@ -3615,7 +3683,10 @@ const WebhookEventJsonSchemas = {
3615
3683
  message: {
3616
3684
  type: "object",
3617
3685
  properties: {
3618
- id: { $ref: "#/$defs/MessageId" },
3686
+ id: {
3687
+ type: "string",
3688
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
3689
+ },
3619
3690
  from: {
3620
3691
  type: "object",
3621
3692
  properties: {
@@ -3653,21 +3724,7 @@ const WebhookEventJsonSchemas = {
3653
3724
  "timestamp",
3654
3725
  "data"
3655
3726
  ],
3656
- additionalProperties: true,
3657
- $defs: {
3658
- MailboxId: {
3659
- type: "string",
3660
- pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
3661
- },
3662
- NamespaceId: {
3663
- type: "string",
3664
- pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
3665
- },
3666
- MessageId: {
3667
- type: "string",
3668
- pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
3669
- }
3670
- }
3727
+ additionalProperties: true
3671
3728
  },
3672
3729
  "mailbox.message.released": {
3673
3730
  type: "object",
@@ -3680,8 +3737,14 @@ const WebhookEventJsonSchemas = {
3680
3737
  data: {
3681
3738
  type: "object",
3682
3739
  properties: {
3683
- mailboxId: { $ref: "#/$defs/MailboxId" },
3684
- namespaceId: { anyOf: [{ $ref: "#/$defs/NamespaceId" }, { type: "null" }] },
3740
+ mailboxId: {
3741
+ type: "string",
3742
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
3743
+ },
3744
+ namespaceId: { anyOf: [{
3745
+ type: "string",
3746
+ pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
3747
+ }, { type: "null" }] },
3685
3748
  releasedBy: {
3686
3749
  type: "object",
3687
3750
  properties: {
@@ -3731,9 +3794,23 @@ const WebhookEventJsonSchemas = {
3731
3794
  message: {
3732
3795
  type: "object",
3733
3796
  properties: {
3734
- id: { $ref: "#/$defs/MessageId" },
3735
- channel: { $ref: "#/$defs/MailboxChannel" },
3736
- threadId: { $ref: "#/$defs/MailboxThreadId" },
3797
+ id: {
3798
+ type: "string",
3799
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
3800
+ },
3801
+ channel: {
3802
+ type: "string",
3803
+ enum: [
3804
+ "email",
3805
+ "whatsapp",
3806
+ "sms"
3807
+ ],
3808
+ description: "Deliveries recorded before this field existed omit it; they are email."
3809
+ },
3810
+ threadId: {
3811
+ type: "string",
3812
+ pattern: "^thread_[0-9a-hjkmnp-tv-z]{16,24}$"
3813
+ },
3737
3814
  from: {
3738
3815
  type: "object",
3739
3816
  properties: {
@@ -3759,7 +3836,10 @@ const WebhookEventJsonSchemas = {
3759
3836
  items: {
3760
3837
  type: "object",
3761
3838
  properties: {
3762
- id: { $ref: "#/$defs/AttachmentId" },
3839
+ id: {
3840
+ type: "string",
3841
+ pattern: "^att_[0-9a-hjkmnp-tv-z]{16,24}$"
3842
+ },
3763
3843
  filename: { type: "string" },
3764
3844
  contentType: { type: "string" },
3765
3845
  size: { type: "number" }
@@ -3792,9 +3872,15 @@ const WebhookEventJsonSchemas = {
3792
3872
  thread: {
3793
3873
  type: "object",
3794
3874
  properties: {
3795
- id: { $ref: "#/$defs/MailboxThreadId" },
3875
+ id: {
3876
+ type: "string",
3877
+ pattern: "^thread_[0-9a-hjkmnp-tv-z]{16,24}$"
3878
+ },
3796
3879
  endpointId: {
3797
- anyOf: [{ $ref: "#/$defs/MailboxEndpointId" }, { type: "null" }],
3880
+ anyOf: [{
3881
+ type: "string",
3882
+ pattern: "^mbxep_[0-9a-hjkmnp-tv-z]{16,24}$"
3883
+ }, { type: "null" }],
3798
3884
  description: "The endpoint the message arrived at; null once it is removed. Deliveries recorded before this field existed omit it."
3799
3885
  },
3800
3886
  subject: { anyOf: [{ type: "string" }, { type: "null" }] },
@@ -3824,42 +3910,7 @@ const WebhookEventJsonSchemas = {
3824
3910
  "timestamp",
3825
3911
  "data"
3826
3912
  ],
3827
- additionalProperties: true,
3828
- $defs: {
3829
- MailboxId: {
3830
- type: "string",
3831
- pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
3832
- },
3833
- NamespaceId: {
3834
- type: "string",
3835
- pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
3836
- },
3837
- MessageId: {
3838
- type: "string",
3839
- pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
3840
- },
3841
- MailboxChannel: {
3842
- type: "string",
3843
- enum: [
3844
- "email",
3845
- "whatsapp",
3846
- "sms"
3847
- ],
3848
- description: "Deliveries recorded before this field existed omit it; they are email."
3849
- },
3850
- MailboxThreadId: {
3851
- type: "string",
3852
- pattern: "^thread_[0-9a-hjkmnp-tv-z]{16,24}$"
3853
- },
3854
- AttachmentId: {
3855
- type: "string",
3856
- pattern: "^att_[0-9a-hjkmnp-tv-z]{16,24}$"
3857
- },
3858
- MailboxEndpointId: {
3859
- type: "string",
3860
- pattern: "^mbxep_[0-9a-hjkmnp-tv-z]{16,24}$"
3861
- }
3862
- }
3913
+ additionalProperties: true
3863
3914
  },
3864
3915
  "mailbox.message.discarded": {
3865
3916
  type: "object",
@@ -3872,8 +3923,14 @@ const WebhookEventJsonSchemas = {
3872
3923
  data: {
3873
3924
  type: "object",
3874
3925
  properties: {
3875
- mailboxId: { $ref: "#/$defs/MailboxId" },
3876
- namespaceId: { anyOf: [{ $ref: "#/$defs/NamespaceId" }, { type: "null" }] },
3926
+ mailboxId: {
3927
+ type: "string",
3928
+ pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
3929
+ },
3930
+ namespaceId: { anyOf: [{
3931
+ type: "string",
3932
+ pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
3933
+ }, { type: "null" }] },
3877
3934
  discardedBy: {
3878
3935
  type: "object",
3879
3936
  properties: {
@@ -3927,7 +3984,10 @@ const WebhookEventJsonSchemas = {
3927
3984
  message: {
3928
3985
  type: "object",
3929
3986
  properties: {
3930
- id: { $ref: "#/$defs/MessageId" },
3987
+ id: {
3988
+ type: "string",
3989
+ pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
3990
+ },
3931
3991
  from: {
3932
3992
  type: "object",
3933
3993
  properties: {
@@ -3965,21 +4025,7 @@ const WebhookEventJsonSchemas = {
3965
4025
  "timestamp",
3966
4026
  "data"
3967
4027
  ],
3968
- additionalProperties: true,
3969
- $defs: {
3970
- MailboxId: {
3971
- type: "string",
3972
- pattern: "^mbx_[0-9a-hjkmnp-tv-z]{16,24}$"
3973
- },
3974
- NamespaceId: {
3975
- type: "string",
3976
- pattern: "^ns_[0-9a-hjkmnp-tv-z]{16,24}$"
3977
- },
3978
- MessageId: {
3979
- type: "string",
3980
- pattern: "^msg_[0-9a-hjkmnp-tv-z]{16,24}$"
3981
- }
3982
- }
4028
+ additionalProperties: true
3983
4029
  },
3984
4030
  "journey.webhook": {
3985
4031
  type: "object",
@@ -3992,15 +4038,27 @@ const WebhookEventJsonSchemas = {
3992
4038
  data: {
3993
4039
  type: "object",
3994
4040
  properties: {
3995
- organizationId: { $ref: "#/$defs/OrganizationId" },
3996
- journeyId: { $ref: "#/$defs/JourneyId" },
4041
+ organizationId: {
4042
+ type: "string",
4043
+ pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
4044
+ },
4045
+ journeyId: {
4046
+ type: "string",
4047
+ pattern: "^jrny_[0-9a-hjkmnp-tv-z]{16,24}$"
4048
+ },
3997
4049
  journeyVersion: { type: "integer" },
3998
- runId: { $ref: "#/$defs/JourneyRunId" },
4050
+ runId: {
4051
+ type: "string",
4052
+ pattern: "^jrun_[0-9a-hjkmnp-tv-z]{16,24}$"
4053
+ },
3999
4054
  nodeId: { type: "string" },
4000
4055
  contact: {
4001
4056
  type: "object",
4002
4057
  properties: {
4003
- id: { $ref: "#/$defs/ContactId" },
4058
+ id: {
4059
+ type: "string",
4060
+ pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
4061
+ },
4004
4062
  externalId: { anyOf: [{ type: "string" }, { type: "null" }] },
4005
4063
  email: { anyOf: [{ type: "string" }, { type: "null" }] }
4006
4064
  },
@@ -4011,7 +4069,7 @@ const WebhookEventJsonSchemas = {
4011
4069
  ],
4012
4070
  additionalProperties: true
4013
4071
  },
4014
- data: { $ref: "#/$defs/JsonObject" }
4072
+ data: { type: "object" }
4015
4073
  },
4016
4074
  required: [
4017
4075
  "organizationId",
@@ -4030,29 +4088,10 @@ const WebhookEventJsonSchemas = {
4030
4088
  "timestamp",
4031
4089
  "data"
4032
4090
  ],
4033
- additionalProperties: true,
4034
- $defs: {
4035
- OrganizationId: {
4036
- type: "string",
4037
- pattern: "^org_[0-9a-hjkmnp-tv-z]{16,24}$"
4038
- },
4039
- JourneyId: {
4040
- type: "string",
4041
- pattern: "^jrny_[0-9a-hjkmnp-tv-z]{16,24}$"
4042
- },
4043
- JourneyRunId: {
4044
- type: "string",
4045
- pattern: "^jrun_[0-9a-hjkmnp-tv-z]{16,24}$"
4046
- },
4047
- ContactId: {
4048
- type: "string",
4049
- pattern: "^contact_[0-9a-hjkmnp-tv-z]{16,24}$"
4050
- },
4051
- JsonObject: { type: "object" }
4052
- }
4091
+ additionalProperties: true
4053
4092
  }
4054
4093
  };
4055
4094
  //#endregion
4056
4095
  export { WebhookEventJsonSchemas as t };
4057
4096
 
4058
- //# sourceMappingURL=json-schemas.gen-CzhmDgcj.js.map
4097
+ //# sourceMappingURL=json-schemas.gen-CPzGmYvg.js.map