@linqapp/sdk 0.46.0 → 0.47.1

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.
@@ -1,6 +1,11 @@
1
1
  import { APIResource } from "../core/resource.js";
2
2
  import * as Shared from "./shared.js";
3
+ import * as WebhookEventsAPI from "./webhook-events.js";
3
4
  export declare class Webhooks extends APIResource {
5
+ unwrap(body: string, { headers, key }: {
6
+ headers: Record<string, string>;
7
+ key?: string;
8
+ }): UnwrapWebhookEvent;
4
9
  }
5
10
  /**
6
11
  * Unified payload for message webhooks when using `webhook_version: "2026-02-03"`.
@@ -625,7 +630,2372 @@ export interface SchemasTextPartResponse {
625
630
  */
626
631
  text_decorations?: Array<Shared.TextDecoration> | null;
627
632
  }
633
+ /**
634
+ * Complete webhook payload for message.sent events (2026-02-03 format)
635
+ */
636
+ export interface MessageSentWebhookEvent {
637
+ /**
638
+ * API version for the webhook payload format
639
+ */
640
+ api_version: string;
641
+ /**
642
+ * When the event was created
643
+ */
644
+ created_at: string;
645
+ /**
646
+ * Unified payload for message webhooks when using `webhook_version: "2026-02-03"`.
647
+ *
648
+ * This schema is used for message.sent, message.received, message.delivered, and
649
+ * message.read events when the subscription URL includes `?version=2026-02-03`.
650
+ *
651
+ * Key differences from V1 (2025-01-01):
652
+ *
653
+ * - `direction`: "inbound" or "outbound" instead of `is_from_me` boolean
654
+ * - `sender_handle`: Full handle object for the sender
655
+ * - `chat`: Nested object with `id`, `is_group`, and `owner_handle`
656
+ * - Message fields (`id`, `parts`, `effect`, etc.) are at the top level, not
657
+ * nested in `message`
658
+ *
659
+ * Timestamps indicate the message state:
660
+ *
661
+ * - `message.sent`: sent_at set, delivered_at=null, read_at=null
662
+ * - `message.received`: sent_at set, delivered_at=null, read_at=null
663
+ * - `message.delivered`: sent_at set, delivered_at set, read_at=null
664
+ * - `message.read`: sent_at set, delivered_at set, read_at set
665
+ */
666
+ data: MessageEventV2;
667
+ /**
668
+ * Unique identifier for this event (for deduplication)
669
+ */
670
+ event_id: string;
671
+ /**
672
+ * Valid webhook event types that can be subscribed to.
673
+ *
674
+ * **Note:** `message.edited` is only delivered to subscriptions using
675
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
676
+ * subscription will not produce any deliveries.
677
+ */
678
+ event_type: WebhookEventsAPI.WebhookEventType;
679
+ /**
680
+ * Partner identifier. Present on all webhooks for cross-referencing.
681
+ */
682
+ partner_id: string;
683
+ /**
684
+ * Trace ID for debugging and correlation across systems.
685
+ */
686
+ trace_id: string;
687
+ /**
688
+ * Date-based webhook payload version. Determined by the `?version=` query
689
+ * parameter in your webhook subscription URL. If no version parameter is
690
+ * specified, defaults based on subscription creation date.
691
+ */
692
+ webhook_version: string;
693
+ }
694
+ /**
695
+ * Complete webhook payload for message.received events (2026-02-03 format)
696
+ */
697
+ export interface MessageReceivedWebhookEvent {
698
+ /**
699
+ * API version for the webhook payload format
700
+ */
701
+ api_version: string;
702
+ /**
703
+ * When the event was created
704
+ */
705
+ created_at: string;
706
+ /**
707
+ * Unified payload for message webhooks when using `webhook_version: "2026-02-03"`.
708
+ *
709
+ * This schema is used for message.sent, message.received, message.delivered, and
710
+ * message.read events when the subscription URL includes `?version=2026-02-03`.
711
+ *
712
+ * Key differences from V1 (2025-01-01):
713
+ *
714
+ * - `direction`: "inbound" or "outbound" instead of `is_from_me` boolean
715
+ * - `sender_handle`: Full handle object for the sender
716
+ * - `chat`: Nested object with `id`, `is_group`, and `owner_handle`
717
+ * - Message fields (`id`, `parts`, `effect`, etc.) are at the top level, not
718
+ * nested in `message`
719
+ *
720
+ * Timestamps indicate the message state:
721
+ *
722
+ * - `message.sent`: sent_at set, delivered_at=null, read_at=null
723
+ * - `message.received`: sent_at set, delivered_at=null, read_at=null
724
+ * - `message.delivered`: sent_at set, delivered_at set, read_at=null
725
+ * - `message.read`: sent_at set, delivered_at set, read_at set
726
+ */
727
+ data: MessageEventV2;
728
+ /**
729
+ * Unique identifier for this event (for deduplication)
730
+ */
731
+ event_id: string;
732
+ /**
733
+ * Valid webhook event types that can be subscribed to.
734
+ *
735
+ * **Note:** `message.edited` is only delivered to subscriptions using
736
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
737
+ * subscription will not produce any deliveries.
738
+ */
739
+ event_type: WebhookEventsAPI.WebhookEventType;
740
+ /**
741
+ * Partner identifier. Present on all webhooks for cross-referencing.
742
+ */
743
+ partner_id: string;
744
+ /**
745
+ * Trace ID for debugging and correlation across systems.
746
+ */
747
+ trace_id: string;
748
+ /**
749
+ * Date-based webhook payload version. Determined by the `?version=` query
750
+ * parameter in your webhook subscription URL. If no version parameter is
751
+ * specified, defaults based on subscription creation date.
752
+ */
753
+ webhook_version: string;
754
+ }
755
+ /**
756
+ * Complete webhook payload for message.read events (2026-02-03 format)
757
+ */
758
+ export interface MessageReadWebhookEvent {
759
+ /**
760
+ * API version for the webhook payload format
761
+ */
762
+ api_version: string;
763
+ /**
764
+ * When the event was created
765
+ */
766
+ created_at: string;
767
+ /**
768
+ * Unified payload for message webhooks when using `webhook_version: "2026-02-03"`.
769
+ *
770
+ * This schema is used for message.sent, message.received, message.delivered, and
771
+ * message.read events when the subscription URL includes `?version=2026-02-03`.
772
+ *
773
+ * Key differences from V1 (2025-01-01):
774
+ *
775
+ * - `direction`: "inbound" or "outbound" instead of `is_from_me` boolean
776
+ * - `sender_handle`: Full handle object for the sender
777
+ * - `chat`: Nested object with `id`, `is_group`, and `owner_handle`
778
+ * - Message fields (`id`, `parts`, `effect`, etc.) are at the top level, not
779
+ * nested in `message`
780
+ *
781
+ * Timestamps indicate the message state:
782
+ *
783
+ * - `message.sent`: sent_at set, delivered_at=null, read_at=null
784
+ * - `message.received`: sent_at set, delivered_at=null, read_at=null
785
+ * - `message.delivered`: sent_at set, delivered_at set, read_at=null
786
+ * - `message.read`: sent_at set, delivered_at set, read_at set
787
+ */
788
+ data: MessageEventV2;
789
+ /**
790
+ * Unique identifier for this event (for deduplication)
791
+ */
792
+ event_id: string;
793
+ /**
794
+ * Valid webhook event types that can be subscribed to.
795
+ *
796
+ * **Note:** `message.edited` is only delivered to subscriptions using
797
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
798
+ * subscription will not produce any deliveries.
799
+ */
800
+ event_type: WebhookEventsAPI.WebhookEventType;
801
+ /**
802
+ * Partner identifier. Present on all webhooks for cross-referencing.
803
+ */
804
+ partner_id: string;
805
+ /**
806
+ * Trace ID for debugging and correlation across systems.
807
+ */
808
+ trace_id: string;
809
+ /**
810
+ * Date-based webhook payload version. Determined by the `?version=` query
811
+ * parameter in your webhook subscription URL. If no version parameter is
812
+ * specified, defaults based on subscription creation date.
813
+ */
814
+ webhook_version: string;
815
+ }
816
+ /**
817
+ * Complete webhook payload for message.delivered events (2026-02-03 format)
818
+ */
819
+ export interface MessageDeliveredWebhookEvent {
820
+ /**
821
+ * API version for the webhook payload format
822
+ */
823
+ api_version: string;
824
+ /**
825
+ * When the event was created
826
+ */
827
+ created_at: string;
828
+ /**
829
+ * Unified payload for message webhooks when using `webhook_version: "2026-02-03"`.
830
+ *
831
+ * This schema is used for message.sent, message.received, message.delivered, and
832
+ * message.read events when the subscription URL includes `?version=2026-02-03`.
833
+ *
834
+ * Key differences from V1 (2025-01-01):
835
+ *
836
+ * - `direction`: "inbound" or "outbound" instead of `is_from_me` boolean
837
+ * - `sender_handle`: Full handle object for the sender
838
+ * - `chat`: Nested object with `id`, `is_group`, and `owner_handle`
839
+ * - Message fields (`id`, `parts`, `effect`, etc.) are at the top level, not
840
+ * nested in `message`
841
+ *
842
+ * Timestamps indicate the message state:
843
+ *
844
+ * - `message.sent`: sent_at set, delivered_at=null, read_at=null
845
+ * - `message.received`: sent_at set, delivered_at=null, read_at=null
846
+ * - `message.delivered`: sent_at set, delivered_at set, read_at=null
847
+ * - `message.read`: sent_at set, delivered_at set, read_at set
848
+ */
849
+ data: MessageEventV2;
850
+ /**
851
+ * Unique identifier for this event (for deduplication)
852
+ */
853
+ event_id: string;
854
+ /**
855
+ * Valid webhook event types that can be subscribed to.
856
+ *
857
+ * **Note:** `message.edited` is only delivered to subscriptions using
858
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
859
+ * subscription will not produce any deliveries.
860
+ */
861
+ event_type: WebhookEventsAPI.WebhookEventType;
862
+ /**
863
+ * Partner identifier. Present on all webhooks for cross-referencing.
864
+ */
865
+ partner_id: string;
866
+ /**
867
+ * Trace ID for debugging and correlation across systems.
868
+ */
869
+ trace_id: string;
870
+ /**
871
+ * Date-based webhook payload version. Determined by the `?version=` query
872
+ * parameter in your webhook subscription URL. If no version parameter is
873
+ * specified, defaults based on subscription creation date.
874
+ */
875
+ webhook_version: string;
876
+ }
877
+ /**
878
+ * Complete webhook payload for message.failed events
879
+ */
880
+ export interface MessageFailedWebhookEvent {
881
+ /**
882
+ * API version for the webhook payload format
883
+ */
884
+ api_version: string;
885
+ /**
886
+ * When the event was created
887
+ */
888
+ created_at: string;
889
+ /**
890
+ * Error details for message.failed webhook events. See
891
+ * [WebhookErrorCode](#/components/schemas/WebhookErrorCode) for the full error
892
+ * code reference.
893
+ *
894
+ * In rare cases the message can still be delivered after this event fires — a
895
+ * `message.delivered` webhook for the same message ID may follow.
896
+ */
897
+ data: MessageFailedWebhookEvent.Data;
898
+ /**
899
+ * Unique identifier for this event (for deduplication)
900
+ */
901
+ event_id: string;
902
+ /**
903
+ * Valid webhook event types that can be subscribed to.
904
+ *
905
+ * **Note:** `message.edited` is only delivered to subscriptions using
906
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
907
+ * subscription will not produce any deliveries.
908
+ */
909
+ event_type: WebhookEventsAPI.WebhookEventType;
910
+ /**
911
+ * Partner identifier. Present on all webhooks for cross-referencing.
912
+ */
913
+ partner_id: string;
914
+ /**
915
+ * Trace ID for debugging and correlation across systems.
916
+ */
917
+ trace_id: string;
918
+ /**
919
+ * Date-based webhook payload version. Determined by the `?version=` query
920
+ * parameter in your webhook subscription URL. If no version parameter is
921
+ * specified, defaults based on subscription creation date.
922
+ */
923
+ webhook_version: string;
924
+ }
925
+ export declare namespace MessageFailedWebhookEvent {
926
+ /**
927
+ * Error details for message.failed webhook events. See
928
+ * [WebhookErrorCode](#/components/schemas/WebhookErrorCode) for the full error
929
+ * code reference.
930
+ *
931
+ * In rare cases the message can still be delivered after this event fires — a
932
+ * `message.delivered` webhook for the same message ID may follow.
933
+ */
934
+ interface Data {
935
+ /**
936
+ * Error codes in webhook failure events. The possible set varies by event:
937
+ * message.failed and poll.failed can carry 3007, 4001, 4002, 4005, 4006, 4007, or
938
+ * 4008; the group update failure events (chat.group_name_update_failed,
939
+ * chat.group_icon_update_failed) carry 3007 or 4001; chat.background_update_failed
940
+ * carries 1005, 2011, 4001, or 5002.
941
+ */
942
+ code: number;
943
+ /**
944
+ * When the failure was detected
945
+ */
946
+ failed_at: string;
947
+ /**
948
+ * Chat identifier (UUID)
949
+ */
950
+ chat_id?: string;
951
+ /**
952
+ * Opaque diagnostic code identifying the specific failure class within `code`.
953
+ * Values are not enumerated and may change without notice — log it and include it
954
+ * in support requests, but do not branch on it.
955
+ */
956
+ detail_code?: number | null;
957
+ /**
958
+ * Message identifier (UUID)
959
+ */
960
+ message_id?: string;
961
+ /**
962
+ * Preferred messaging service type. Includes "auto" for default fallback behavior.
963
+ */
964
+ preferred_service?: 'iMessage' | 'SMS' | 'RCS' | 'auto' | null;
965
+ /**
966
+ * Human-readable description of the failure
967
+ */
968
+ reason?: string;
969
+ /**
970
+ * Messaging service type
971
+ */
972
+ service?: Shared.ServiceType | null;
973
+ }
974
+ }
975
+ /**
976
+ * Complete webhook payload for message.edited events (2026-02-03 format only)
977
+ */
978
+ export interface MessageEditedWebhookEvent {
979
+ /**
980
+ * API version for the webhook payload format
981
+ */
982
+ api_version: string;
983
+ /**
984
+ * When the event was created
985
+ */
986
+ created_at: string;
987
+ /**
988
+ * Payload for `message.edited` events (2026-02-03 format).
989
+ *
990
+ * Describes which part of a message was edited and when. Only text parts can be
991
+ * edited. Only available for subscriptions using `webhook_version: "2026-02-03"`.
992
+ */
993
+ data: MessageEditedWebhookEvent.Data;
994
+ /**
995
+ * Unique identifier for this event (for deduplication)
996
+ */
997
+ event_id: string;
998
+ /**
999
+ * Valid webhook event types that can be subscribed to.
1000
+ *
1001
+ * **Note:** `message.edited` is only delivered to subscriptions using
1002
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
1003
+ * subscription will not produce any deliveries.
1004
+ */
1005
+ event_type: WebhookEventsAPI.WebhookEventType;
1006
+ /**
1007
+ * Partner identifier. Present on all webhooks for cross-referencing.
1008
+ */
1009
+ partner_id: string;
1010
+ /**
1011
+ * Trace ID for debugging and correlation across systems.
1012
+ */
1013
+ trace_id: string;
1014
+ /**
1015
+ * Date-based webhook payload version. Determined by the `?version=` query
1016
+ * parameter in your webhook subscription URL. If no version parameter is
1017
+ * specified, defaults based on subscription creation date.
1018
+ */
1019
+ webhook_version: string;
1020
+ }
1021
+ export declare namespace MessageEditedWebhookEvent {
1022
+ /**
1023
+ * Payload for `message.edited` events (2026-02-03 format).
1024
+ *
1025
+ * Describes which part of a message was edited and when. Only text parts can be
1026
+ * edited. Only available for subscriptions using `webhook_version: "2026-02-03"`.
1027
+ */
1028
+ interface Data {
1029
+ /**
1030
+ * Message identifier
1031
+ */
1032
+ id: string;
1033
+ /**
1034
+ * Chat context
1035
+ */
1036
+ chat: Data.Chat;
1037
+ /**
1038
+ * "outbound" if you sent the original message, "inbound" if you received it
1039
+ */
1040
+ direction: 'outbound' | 'inbound';
1041
+ /**
1042
+ * When the edit occurred
1043
+ */
1044
+ edited_at: string;
1045
+ /**
1046
+ * The edited part
1047
+ */
1048
+ part: Data.Part;
1049
+ /**
1050
+ * The handle that sent (and edited) this message
1051
+ */
1052
+ sender_handle: Shared.ChatHandle;
1053
+ }
1054
+ namespace Data {
1055
+ /**
1056
+ * Chat context
1057
+ */
1058
+ interface Chat {
1059
+ /**
1060
+ * Chat identifier
1061
+ */
1062
+ id: string;
1063
+ /**
1064
+ * **[BETA]** Current health for a chat. Always present — chats start at `HEALTHY`
1065
+ * and may shift based on engagement and delivery signals on the conversation. Many
1066
+ * `AT_RISK` or `CRITICAL` chats on a single line increase the risk of line
1067
+ * flagging.
1068
+ *
1069
+ * Switch on `status` to surface chat and line health in your UI — the enum is the
1070
+ * long-term contract. Each status carries a `doc_url` that deep-links to the
1071
+ * relevant section of the Chat Health guide. To gate a send, act on the response
1072
+ * rather than the status: a `403` is the authoritative answer.
1073
+ *
1074
+ * See the [Chat Health guide](/guides/chats/chat-health) for what each status
1075
+ * means and how to react.
1076
+ */
1077
+ health_status: Chat.HealthStatus;
1078
+ /**
1079
+ * Whether this is a group chat
1080
+ */
1081
+ is_group: boolean;
1082
+ /**
1083
+ * The handle that owns this chat (your phone number)
1084
+ */
1085
+ owner_handle: Shared.ChatHandle;
1086
+ }
1087
+ namespace Chat {
1088
+ /**
1089
+ * **[BETA]** Current health for a chat. Always present — chats start at `HEALTHY`
1090
+ * and may shift based on engagement and delivery signals on the conversation. Many
1091
+ * `AT_RISK` or `CRITICAL` chats on a single line increase the risk of line
1092
+ * flagging.
1093
+ *
1094
+ * Switch on `status` to surface chat and line health in your UI — the enum is the
1095
+ * long-term contract. Each status carries a `doc_url` that deep-links to the
1096
+ * relevant section of the Chat Health guide. To gate a send, act on the response
1097
+ * rather than the status: a `403` is the authoritative answer.
1098
+ *
1099
+ * See the [Chat Health guide](/guides/chats/chat-health) for what each status
1100
+ * means and how to react.
1101
+ */
1102
+ interface HealthStatus {
1103
+ /**
1104
+ * Deep-link to the relevant section of the Chat Health guide for this status.
1105
+ */
1106
+ doc_url: string;
1107
+ /**
1108
+ * Current health bucket for the chat. See the
1109
+ * [Chat Health guide](/guides/chats/chat-health) for what each value means and how
1110
+ * to react. `doc_url` deep-links to the relevant section.
1111
+ *
1112
+ * `OPTED_OUT` — the recipient sent `STOP`, `UNSUBSCRIBE`, `OPTOUT`, `CANCEL`,
1113
+ * `END`, or `QUIT`. The keyword must be the whole trimmed message, never part of a
1114
+ * longer one: `STOP` counts, `please stop` does not. Most keywords must match
1115
+ * exactly, including case. `OPT OUT` is the exception — it matches in any casing,
1116
+ * with or without the space or a hyphen, so `opt out`, `Opt-Out` and `optout` all
1117
+ * count. It clears as soon as they reply again: any later message from them that
1118
+ * is not itself an opt-out keyword opts them back in immediately — a reply in any
1119
+ * conversation with you counts, the same way the block does.
1120
+ *
1121
+ * `OPTED_OUT` marks only the conversation the keyword arrived in. The block below
1122
+ * is wider than the mark, so a conversation still reading `HEALTHY` can be blocked
1123
+ * as well — gate on the `403`, not on the status. Group threads are never marked
1124
+ * and are never blocked.
1125
+ *
1126
+ * Linq enforces this: while a recipient is opted out, every send to them is
1127
+ * rejected with `403` (error code `2024`) before the message is queued, across
1128
+ * every chat and every line on your account. Nothing is delivered, including a
1129
+ * final courtesy message — to send one, set `override_optout: true` on that single
1130
+ * request.
1131
+ */
1132
+ status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT';
1133
+ /**
1134
+ * When this status last changed.
1135
+ */
1136
+ updated_at: string;
1137
+ }
1138
+ }
1139
+ /**
1140
+ * The edited part
1141
+ */
1142
+ interface Part {
1143
+ /**
1144
+ * Zero-based index of the edited part within the message
1145
+ */
1146
+ index: number;
1147
+ /**
1148
+ * New text content of the part
1149
+ */
1150
+ text: string;
1151
+ }
1152
+ }
1153
+ }
1154
+ /**
1155
+ * Complete webhook payload for reaction.added events
1156
+ */
1157
+ export interface ReactionAddedWebhookEvent {
1158
+ /**
1159
+ * API version for the webhook payload format
1160
+ */
1161
+ api_version: string;
1162
+ /**
1163
+ * When the event was created
1164
+ */
1165
+ created_at: string;
1166
+ /**
1167
+ * Payload for reaction.added webhook events
1168
+ */
1169
+ data: ReactionEventBase;
1170
+ /**
1171
+ * Unique identifier for this event (for deduplication)
1172
+ */
1173
+ event_id: string;
1174
+ /**
1175
+ * Valid webhook event types that can be subscribed to.
1176
+ *
1177
+ * **Note:** `message.edited` is only delivered to subscriptions using
1178
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
1179
+ * subscription will not produce any deliveries.
1180
+ */
1181
+ event_type: WebhookEventsAPI.WebhookEventType;
1182
+ /**
1183
+ * Partner identifier. Present on all webhooks for cross-referencing.
1184
+ */
1185
+ partner_id: string;
1186
+ /**
1187
+ * Trace ID for debugging and correlation across systems.
1188
+ */
1189
+ trace_id: string;
1190
+ /**
1191
+ * Date-based webhook payload version. Determined by the `?version=` query
1192
+ * parameter in your webhook subscription URL. If no version parameter is
1193
+ * specified, defaults based on subscription creation date.
1194
+ */
1195
+ webhook_version: string;
1196
+ }
1197
+ /**
1198
+ * Complete webhook payload for reaction.removed events
1199
+ */
1200
+ export interface ReactionRemovedWebhookEvent {
1201
+ /**
1202
+ * API version for the webhook payload format
1203
+ */
1204
+ api_version: string;
1205
+ /**
1206
+ * When the event was created
1207
+ */
1208
+ created_at: string;
1209
+ /**
1210
+ * Payload for reaction.removed webhook events
1211
+ */
1212
+ data: ReactionEventBase;
1213
+ /**
1214
+ * Unique identifier for this event (for deduplication)
1215
+ */
1216
+ event_id: string;
1217
+ /**
1218
+ * Valid webhook event types that can be subscribed to.
1219
+ *
1220
+ * **Note:** `message.edited` is only delivered to subscriptions using
1221
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
1222
+ * subscription will not produce any deliveries.
1223
+ */
1224
+ event_type: WebhookEventsAPI.WebhookEventType;
1225
+ /**
1226
+ * Partner identifier. Present on all webhooks for cross-referencing.
1227
+ */
1228
+ partner_id: string;
1229
+ /**
1230
+ * Trace ID for debugging and correlation across systems.
1231
+ */
1232
+ trace_id: string;
1233
+ /**
1234
+ * Date-based webhook payload version. Determined by the `?version=` query
1235
+ * parameter in your webhook subscription URL. If no version parameter is
1236
+ * specified, defaults based on subscription creation date.
1237
+ */
1238
+ webhook_version: string;
1239
+ }
1240
+ /**
1241
+ * Complete webhook payload for poll.received events
1242
+ */
1243
+ export interface PollReceivedWebhookEvent {
1244
+ /**
1245
+ * API version for the webhook payload format
1246
+ */
1247
+ api_version: string;
1248
+ /**
1249
+ * When the event was created
1250
+ */
1251
+ created_at: string;
1252
+ /**
1253
+ * Payload for poll.received — a poll created by someone else and delivered to your
1254
+ * line. Carries the full poll snapshot (options, no voters yet) at receipt time.
1255
+ */
1256
+ data: PollReceivedWebhookEvent.Data;
1257
+ /**
1258
+ * Unique identifier for this event (for deduplication)
1259
+ */
1260
+ event_id: string;
1261
+ /**
1262
+ * Valid webhook event types that can be subscribed to.
1263
+ *
1264
+ * **Note:** `message.edited` is only delivered to subscriptions using
1265
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
1266
+ * subscription will not produce any deliveries.
1267
+ */
1268
+ event_type: WebhookEventsAPI.WebhookEventType;
1269
+ /**
1270
+ * Partner identifier. Present on all webhooks for cross-referencing.
1271
+ */
1272
+ partner_id: string;
1273
+ /**
1274
+ * Trace ID for debugging and correlation across systems.
1275
+ */
1276
+ trace_id: string;
1277
+ /**
1278
+ * Date-based webhook payload version. Determined by the `?version=` query
1279
+ * parameter in your webhook subscription URL. If no version parameter is
1280
+ * specified, defaults based on subscription creation date.
1281
+ */
1282
+ webhook_version: string;
1283
+ }
1284
+ export declare namespace PollReceivedWebhookEvent {
1285
+ /**
1286
+ * Payload for poll.received — a poll created by someone else and delivered to your
1287
+ * line. Carries the full poll snapshot (options, no voters yet) at receipt time.
1288
+ */
1289
+ interface Data {
1290
+ /**
1291
+ * Chat info for poll webhook events.
1292
+ */
1293
+ chat: Data.Chat;
1294
+ created_at: string;
1295
+ direction: 'inbound' | 'outbound';
1296
+ message_id: string;
1297
+ poll: Data.Poll;
1298
+ received_at: string;
1299
+ service: string;
1300
+ updated_at: string;
1301
+ /**
1302
+ * The line that created the poll (is_me=false for an inbound poll).
1303
+ */
1304
+ sender_handle?: Shared.ChatHandle | null;
1305
+ }
1306
+ namespace Data {
1307
+ /**
1308
+ * Chat info for poll webhook events.
1309
+ */
1310
+ interface Chat {
1311
+ id: string;
1312
+ is_group?: boolean | null;
1313
+ owner_handle?: Shared.ChatHandle | null;
1314
+ }
1315
+ interface Poll {
1316
+ options: Array<Poll.Option>;
1317
+ /**
1318
+ * Distinct participants across the whole poll.
1319
+ */
1320
+ total_voters: number;
1321
+ }
1322
+ namespace Poll {
1323
+ interface Option {
1324
+ can_be_edited: boolean;
1325
+ /**
1326
+ * The participant who added this option (poll creator for the initial options;
1327
+ * whoever added later ones). On a poll.updated this differs from the event's
1328
+ * `sender_handle` whenever a remote participant added the option. Null when
1329
+ * unknown.
1330
+ */
1331
+ creator_handle: Shared.ChatHandle;
1332
+ option_id: string;
1333
+ text: string;
1334
+ voters: Array<Option.Voter>;
1335
+ }
1336
+ namespace Option {
1337
+ interface Voter {
1338
+ handle: string;
1339
+ voted_at: string;
1340
+ }
1341
+ }
1342
+ }
1343
+ }
1344
+ }
1345
+ /**
1346
+ * Complete webhook payload for poll.sent events
1347
+ */
1348
+ export interface PollSentWebhookEvent {
1349
+ /**
1350
+ * API version for the webhook payload format
1351
+ */
1352
+ api_version: string;
1353
+ /**
1354
+ * When the event was created
1355
+ */
1356
+ created_at: string;
1357
+ /**
1358
+ * Payload for poll.sent, poll.delivered, and poll.read webhook events. Timestamps
1359
+ * indicate state (null = not yet happened): sent → sent_at; delivered →
1360
+ * +delivered_at; read → +read_at.
1361
+ */
1362
+ data: PollSentWebhookEvent.Data;
1363
+ /**
1364
+ * Unique identifier for this event (for deduplication)
1365
+ */
1366
+ event_id: string;
1367
+ /**
1368
+ * Valid webhook event types that can be subscribed to.
1369
+ *
1370
+ * **Note:** `message.edited` is only delivered to subscriptions using
1371
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
1372
+ * subscription will not produce any deliveries.
1373
+ */
1374
+ event_type: WebhookEventsAPI.WebhookEventType;
1375
+ /**
1376
+ * Partner identifier. Present on all webhooks for cross-referencing.
1377
+ */
1378
+ partner_id: string;
1379
+ /**
1380
+ * Trace ID for debugging and correlation across systems.
1381
+ */
1382
+ trace_id: string;
1383
+ /**
1384
+ * Date-based webhook payload version. Determined by the `?version=` query
1385
+ * parameter in your webhook subscription URL. If no version parameter is
1386
+ * specified, defaults based on subscription creation date.
1387
+ */
1388
+ webhook_version: string;
1389
+ }
1390
+ export declare namespace PollSentWebhookEvent {
1391
+ /**
1392
+ * Payload for poll.sent, poll.delivered, and poll.read webhook events. Timestamps
1393
+ * indicate state (null = not yet happened): sent → sent_at; delivered →
1394
+ * +delivered_at; read → +read_at.
1395
+ */
1396
+ interface Data {
1397
+ /**
1398
+ * Chat info for poll webhook events.
1399
+ */
1400
+ chat: Data.Chat;
1401
+ created_at: string;
1402
+ direction: 'inbound' | 'outbound';
1403
+ message_id: string;
1404
+ poll: Data.Poll;
1405
+ service: string;
1406
+ updated_at: string;
1407
+ delivered_at?: string | null;
1408
+ read_at?: string | null;
1409
+ /**
1410
+ * The handle that sent the poll.
1411
+ */
1412
+ sender_handle?: Shared.ChatHandle | null;
1413
+ sent_at?: string | null;
1414
+ }
1415
+ namespace Data {
1416
+ /**
1417
+ * Chat info for poll webhook events.
1418
+ */
1419
+ interface Chat {
1420
+ id: string;
1421
+ is_group?: boolean | null;
1422
+ owner_handle?: Shared.ChatHandle | null;
1423
+ }
1424
+ interface Poll {
1425
+ options: Array<Poll.Option>;
1426
+ /**
1427
+ * Distinct participants across the whole poll.
1428
+ */
1429
+ total_voters: number;
1430
+ }
1431
+ namespace Poll {
1432
+ interface Option {
1433
+ can_be_edited: boolean;
1434
+ /**
1435
+ * The participant who added this option (poll creator for the initial options;
1436
+ * whoever added later ones). On a poll.updated this differs from the event's
1437
+ * `sender_handle` whenever a remote participant added the option. Null when
1438
+ * unknown.
1439
+ */
1440
+ creator_handle: Shared.ChatHandle;
1441
+ option_id: string;
1442
+ text: string;
1443
+ voters: Array<Option.Voter>;
1444
+ }
1445
+ namespace Option {
1446
+ interface Voter {
1447
+ handle: string;
1448
+ voted_at: string;
1449
+ }
1450
+ }
1451
+ }
1452
+ }
1453
+ }
1454
+ /**
1455
+ * Complete webhook payload for poll.delivered events
1456
+ */
1457
+ export interface PollDeliveredWebhookEvent {
1458
+ /**
1459
+ * API version for the webhook payload format
1460
+ */
1461
+ api_version: string;
1462
+ /**
1463
+ * When the event was created
1464
+ */
1465
+ created_at: string;
1466
+ /**
1467
+ * Payload for poll.sent, poll.delivered, and poll.read webhook events. Timestamps
1468
+ * indicate state (null = not yet happened): sent → sent_at; delivered →
1469
+ * +delivered_at; read → +read_at.
1470
+ */
1471
+ data: PollDeliveredWebhookEvent.Data;
1472
+ /**
1473
+ * Unique identifier for this event (for deduplication)
1474
+ */
1475
+ event_id: string;
1476
+ /**
1477
+ * Valid webhook event types that can be subscribed to.
1478
+ *
1479
+ * **Note:** `message.edited` is only delivered to subscriptions using
1480
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
1481
+ * subscription will not produce any deliveries.
1482
+ */
1483
+ event_type: WebhookEventsAPI.WebhookEventType;
1484
+ /**
1485
+ * Partner identifier. Present on all webhooks for cross-referencing.
1486
+ */
1487
+ partner_id: string;
1488
+ /**
1489
+ * Trace ID for debugging and correlation across systems.
1490
+ */
1491
+ trace_id: string;
1492
+ /**
1493
+ * Date-based webhook payload version. Determined by the `?version=` query
1494
+ * parameter in your webhook subscription URL. If no version parameter is
1495
+ * specified, defaults based on subscription creation date.
1496
+ */
1497
+ webhook_version: string;
1498
+ }
1499
+ export declare namespace PollDeliveredWebhookEvent {
1500
+ /**
1501
+ * Payload for poll.sent, poll.delivered, and poll.read webhook events. Timestamps
1502
+ * indicate state (null = not yet happened): sent → sent_at; delivered →
1503
+ * +delivered_at; read → +read_at.
1504
+ */
1505
+ interface Data {
1506
+ /**
1507
+ * Chat info for poll webhook events.
1508
+ */
1509
+ chat: Data.Chat;
1510
+ created_at: string;
1511
+ direction: 'inbound' | 'outbound';
1512
+ message_id: string;
1513
+ poll: Data.Poll;
1514
+ service: string;
1515
+ updated_at: string;
1516
+ delivered_at?: string | null;
1517
+ read_at?: string | null;
1518
+ /**
1519
+ * The handle that sent the poll.
1520
+ */
1521
+ sender_handle?: Shared.ChatHandle | null;
1522
+ sent_at?: string | null;
1523
+ }
1524
+ namespace Data {
1525
+ /**
1526
+ * Chat info for poll webhook events.
1527
+ */
1528
+ interface Chat {
1529
+ id: string;
1530
+ is_group?: boolean | null;
1531
+ owner_handle?: Shared.ChatHandle | null;
1532
+ }
1533
+ interface Poll {
1534
+ options: Array<Poll.Option>;
1535
+ /**
1536
+ * Distinct participants across the whole poll.
1537
+ */
1538
+ total_voters: number;
1539
+ }
1540
+ namespace Poll {
1541
+ interface Option {
1542
+ can_be_edited: boolean;
1543
+ /**
1544
+ * The participant who added this option (poll creator for the initial options;
1545
+ * whoever added later ones). On a poll.updated this differs from the event's
1546
+ * `sender_handle` whenever a remote participant added the option. Null when
1547
+ * unknown.
1548
+ */
1549
+ creator_handle: Shared.ChatHandle;
1550
+ option_id: string;
1551
+ text: string;
1552
+ voters: Array<Option.Voter>;
1553
+ }
1554
+ namespace Option {
1555
+ interface Voter {
1556
+ handle: string;
1557
+ voted_at: string;
1558
+ }
1559
+ }
1560
+ }
1561
+ }
1562
+ }
1563
+ /**
1564
+ * Complete webhook payload for poll.read events
1565
+ */
1566
+ export interface PollReadWebhookEvent {
1567
+ /**
1568
+ * API version for the webhook payload format
1569
+ */
1570
+ api_version: string;
1571
+ /**
1572
+ * When the event was created
1573
+ */
1574
+ created_at: string;
1575
+ /**
1576
+ * Payload for poll.sent, poll.delivered, and poll.read webhook events. Timestamps
1577
+ * indicate state (null = not yet happened): sent → sent_at; delivered →
1578
+ * +delivered_at; read → +read_at.
1579
+ */
1580
+ data: PollReadWebhookEvent.Data;
1581
+ /**
1582
+ * Unique identifier for this event (for deduplication)
1583
+ */
1584
+ event_id: string;
1585
+ /**
1586
+ * Valid webhook event types that can be subscribed to.
1587
+ *
1588
+ * **Note:** `message.edited` is only delivered to subscriptions using
1589
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
1590
+ * subscription will not produce any deliveries.
1591
+ */
1592
+ event_type: WebhookEventsAPI.WebhookEventType;
1593
+ /**
1594
+ * Partner identifier. Present on all webhooks for cross-referencing.
1595
+ */
1596
+ partner_id: string;
1597
+ /**
1598
+ * Trace ID for debugging and correlation across systems.
1599
+ */
1600
+ trace_id: string;
1601
+ /**
1602
+ * Date-based webhook payload version. Determined by the `?version=` query
1603
+ * parameter in your webhook subscription URL. If no version parameter is
1604
+ * specified, defaults based on subscription creation date.
1605
+ */
1606
+ webhook_version: string;
1607
+ }
1608
+ export declare namespace PollReadWebhookEvent {
1609
+ /**
1610
+ * Payload for poll.sent, poll.delivered, and poll.read webhook events. Timestamps
1611
+ * indicate state (null = not yet happened): sent → sent_at; delivered →
1612
+ * +delivered_at; read → +read_at.
1613
+ */
1614
+ interface Data {
1615
+ /**
1616
+ * Chat info for poll webhook events.
1617
+ */
1618
+ chat: Data.Chat;
1619
+ created_at: string;
1620
+ direction: 'inbound' | 'outbound';
1621
+ message_id: string;
1622
+ poll: Data.Poll;
1623
+ service: string;
1624
+ updated_at: string;
1625
+ delivered_at?: string | null;
1626
+ read_at?: string | null;
1627
+ /**
1628
+ * The handle that sent the poll.
1629
+ */
1630
+ sender_handle?: Shared.ChatHandle | null;
1631
+ sent_at?: string | null;
1632
+ }
1633
+ namespace Data {
1634
+ /**
1635
+ * Chat info for poll webhook events.
1636
+ */
1637
+ interface Chat {
1638
+ id: string;
1639
+ is_group?: boolean | null;
1640
+ owner_handle?: Shared.ChatHandle | null;
1641
+ }
1642
+ interface Poll {
1643
+ options: Array<Poll.Option>;
1644
+ /**
1645
+ * Distinct participants across the whole poll.
1646
+ */
1647
+ total_voters: number;
1648
+ }
1649
+ namespace Poll {
1650
+ interface Option {
1651
+ can_be_edited: boolean;
1652
+ /**
1653
+ * The participant who added this option (poll creator for the initial options;
1654
+ * whoever added later ones). On a poll.updated this differs from the event's
1655
+ * `sender_handle` whenever a remote participant added the option. Null when
1656
+ * unknown.
1657
+ */
1658
+ creator_handle: Shared.ChatHandle;
1659
+ option_id: string;
1660
+ text: string;
1661
+ voters: Array<Option.Voter>;
1662
+ }
1663
+ namespace Option {
1664
+ interface Voter {
1665
+ handle: string;
1666
+ voted_at: string;
1667
+ }
1668
+ }
1669
+ }
1670
+ }
1671
+ }
1672
+ /**
1673
+ * Complete webhook payload for poll.updated events
1674
+ */
1675
+ export interface PollUpdatedWebhookEvent {
1676
+ /**
1677
+ * API version for the webhook payload format
1678
+ */
1679
+ api_version: string;
1680
+ /**
1681
+ * When the event was created
1682
+ */
1683
+ created_at: string;
1684
+ /**
1685
+ * Payload for poll.updated (option(s) added — add-only).
1686
+ */
1687
+ data: PollUpdatedWebhookEvent.Data;
1688
+ /**
1689
+ * Unique identifier for this event (for deduplication)
1690
+ */
1691
+ event_id: string;
1692
+ /**
1693
+ * Valid webhook event types that can be subscribed to.
1694
+ *
1695
+ * **Note:** `message.edited` is only delivered to subscriptions using
1696
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
1697
+ * subscription will not produce any deliveries.
1698
+ */
1699
+ event_type: WebhookEventsAPI.WebhookEventType;
1700
+ /**
1701
+ * Partner identifier. Present on all webhooks for cross-referencing.
1702
+ */
1703
+ partner_id: string;
1704
+ /**
1705
+ * Trace ID for debugging and correlation across systems.
1706
+ */
1707
+ trace_id: string;
1708
+ /**
1709
+ * Date-based webhook payload version. Determined by the `?version=` query
1710
+ * parameter in your webhook subscription URL. If no version parameter is
1711
+ * specified, defaults based on subscription creation date.
1712
+ */
1713
+ webhook_version: string;
1714
+ }
1715
+ export declare namespace PollUpdatedWebhookEvent {
1716
+ /**
1717
+ * Payload for poll.updated (option(s) added — add-only).
1718
+ */
1719
+ interface Data {
1720
+ /**
1721
+ * Only the options this update added — never the ones the poll already had. Fetch
1722
+ * the poll to read its full option set.
1723
+ */
1724
+ added_options: Array<Data.AddedOption>;
1725
+ /**
1726
+ * Chat info for poll webhook events.
1727
+ */
1728
+ chat: Data.Chat;
1729
+ direction: 'inbound' | 'outbound';
1730
+ message_id: string;
1731
+ /**
1732
+ * Your line — the one that received or sent this update. Always present. On an
1733
+ * inbound update this is NOT who added the option: use
1734
+ * `added_options[].creator_handle` for that, which will be the remote participant.
1735
+ */
1736
+ sender_handle: Shared.ChatHandle;
1737
+ service: string;
1738
+ }
1739
+ namespace Data {
1740
+ interface AddedOption {
1741
+ can_be_edited: boolean;
1742
+ /**
1743
+ * The participant who added this option (poll creator for the initial options;
1744
+ * whoever added later ones). On a poll.updated this differs from the event's
1745
+ * `sender_handle` whenever a remote participant added the option. Null when
1746
+ * unknown.
1747
+ */
1748
+ creator_handle: Shared.ChatHandle;
1749
+ option_id: string;
1750
+ text: string;
1751
+ voters: Array<AddedOption.Voter>;
1752
+ }
1753
+ namespace AddedOption {
1754
+ interface Voter {
1755
+ handle: string;
1756
+ voted_at: string;
1757
+ }
1758
+ }
1759
+ /**
1760
+ * Chat info for poll webhook events.
1761
+ */
1762
+ interface Chat {
1763
+ id: string;
1764
+ is_group?: boolean | null;
1765
+ owner_handle?: Shared.ChatHandle | null;
1766
+ }
1767
+ }
1768
+ }
1769
+ /**
1770
+ * Complete webhook payload for poll.failed events
1771
+ */
1772
+ export interface PollFailedWebhookEvent {
1773
+ /**
1774
+ * API version for the webhook payload format
1775
+ */
1776
+ api_version: string;
1777
+ /**
1778
+ * When the event was created
1779
+ */
1780
+ created_at: string;
1781
+ /**
1782
+ * Payload for poll.failed — an outbound poll (or poll action) that failed to send.
1783
+ * Carries the poll snapshot at failure time plus the error and when it failed.
1784
+ */
1785
+ data: PollFailedWebhookEvent.Data;
1786
+ /**
1787
+ * Unique identifier for this event (for deduplication)
1788
+ */
1789
+ event_id: string;
1790
+ /**
1791
+ * Valid webhook event types that can be subscribed to.
1792
+ *
1793
+ * **Note:** `message.edited` is only delivered to subscriptions using
1794
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
1795
+ * subscription will not produce any deliveries.
1796
+ */
1797
+ event_type: WebhookEventsAPI.WebhookEventType;
1798
+ /**
1799
+ * Partner identifier. Present on all webhooks for cross-referencing.
1800
+ */
1801
+ partner_id: string;
1802
+ /**
1803
+ * Trace ID for debugging and correlation across systems.
1804
+ */
1805
+ trace_id: string;
1806
+ /**
1807
+ * Date-based webhook payload version. Determined by the `?version=` query
1808
+ * parameter in your webhook subscription URL. If no version parameter is
1809
+ * specified, defaults based on subscription creation date.
1810
+ */
1811
+ webhook_version: string;
1812
+ }
1813
+ export declare namespace PollFailedWebhookEvent {
1814
+ /**
1815
+ * Payload for poll.failed — an outbound poll (or poll action) that failed to send.
1816
+ * Carries the poll snapshot at failure time plus the error and when it failed.
1817
+ */
1818
+ interface Data {
1819
+ /**
1820
+ * Chat info for poll webhook events.
1821
+ */
1822
+ chat: Data.Chat;
1823
+ direction: 'inbound' | 'outbound';
1824
+ error: Data.Error;
1825
+ failed_at: string;
1826
+ message_id: string;
1827
+ poll: Data.Poll;
1828
+ service: string;
1829
+ /**
1830
+ * Null on failure (the send never landed).
1831
+ */
1832
+ sender_handle?: Shared.ChatHandle | null;
1833
+ }
1834
+ namespace Data {
1835
+ /**
1836
+ * Chat info for poll webhook events.
1837
+ */
1838
+ interface Chat {
1839
+ id: string;
1840
+ is_group?: boolean | null;
1841
+ owner_handle?: Shared.ChatHandle | null;
1842
+ }
1843
+ interface Error {
1844
+ /**
1845
+ * Error codes in webhook failure events. The possible set varies by event:
1846
+ * message.failed and poll.failed can carry 3007, 4001, 4002, 4005, 4006, 4007, or
1847
+ * 4008; the group update failure events (chat.group_name_update_failed,
1848
+ * chat.group_icon_update_failed) carry 3007 or 4001; chat.background_update_failed
1849
+ * carries 1005, 2011, 4001, or 5002.
1850
+ */
1851
+ code: number;
1852
+ message: string;
1853
+ }
1854
+ interface Poll {
1855
+ options: Array<Poll.Option>;
1856
+ /**
1857
+ * Distinct participants across the whole poll.
1858
+ */
1859
+ total_voters: number;
1860
+ }
1861
+ namespace Poll {
1862
+ interface Option {
1863
+ can_be_edited: boolean;
1864
+ /**
1865
+ * The participant who added this option (poll creator for the initial options;
1866
+ * whoever added later ones). On a poll.updated this differs from the event's
1867
+ * `sender_handle` whenever a remote participant added the option. Null when
1868
+ * unknown.
1869
+ */
1870
+ creator_handle: Shared.ChatHandle;
1871
+ option_id: string;
1872
+ text: string;
1873
+ voters: Array<Option.Voter>;
1874
+ }
1875
+ namespace Option {
1876
+ interface Voter {
1877
+ handle: string;
1878
+ voted_at: string;
1879
+ }
1880
+ }
1881
+ }
1882
+ }
1883
+ }
1884
+ /**
1885
+ * Complete webhook payload for poll.vote.added events
1886
+ */
1887
+ export interface PollVoteAddedWebhookEvent {
1888
+ /**
1889
+ * API version for the webhook payload format
1890
+ */
1891
+ api_version: string;
1892
+ /**
1893
+ * When the event was created
1894
+ */
1895
+ created_at: string;
1896
+ /**
1897
+ * Payload for poll.vote.added and poll.vote.removed (one option toggled).
1898
+ */
1899
+ data: PollVoteAddedWebhookEvent.Data;
1900
+ /**
1901
+ * Unique identifier for this event (for deduplication)
1902
+ */
1903
+ event_id: string;
1904
+ /**
1905
+ * Valid webhook event types that can be subscribed to.
1906
+ *
1907
+ * **Note:** `message.edited` is only delivered to subscriptions using
1908
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
1909
+ * subscription will not produce any deliveries.
1910
+ */
1911
+ event_type: WebhookEventsAPI.WebhookEventType;
1912
+ /**
1913
+ * Partner identifier. Present on all webhooks for cross-referencing.
1914
+ */
1915
+ partner_id: string;
1916
+ /**
1917
+ * Trace ID for debugging and correlation across systems.
1918
+ */
1919
+ trace_id: string;
1920
+ /**
1921
+ * Date-based webhook payload version. Determined by the `?version=` query
1922
+ * parameter in your webhook subscription URL. If no version parameter is
1923
+ * specified, defaults based on subscription creation date.
1924
+ */
1925
+ webhook_version: string;
1926
+ }
1927
+ export declare namespace PollVoteAddedWebhookEvent {
1928
+ /**
1929
+ * Payload for poll.vote.added and poll.vote.removed (one option toggled).
1930
+ */
1931
+ interface Data {
1932
+ /**
1933
+ * Chat info for poll webhook events.
1934
+ */
1935
+ chat: Data.Chat;
1936
+ direction: 'inbound' | 'outbound';
1937
+ message_id: string;
1938
+ option_id: string;
1939
+ /**
1940
+ * The voter — always present.
1941
+ */
1942
+ sender_handle: Shared.ChatHandle;
1943
+ service: string;
1944
+ }
1945
+ namespace Data {
1946
+ /**
1947
+ * Chat info for poll webhook events.
1948
+ */
1949
+ interface Chat {
1950
+ id: string;
1951
+ is_group?: boolean | null;
1952
+ owner_handle?: Shared.ChatHandle | null;
1953
+ }
1954
+ }
1955
+ }
1956
+ /**
1957
+ * Complete webhook payload for poll.vote.removed events
1958
+ */
1959
+ export interface PollVoteRemovedWebhookEvent {
1960
+ /**
1961
+ * API version for the webhook payload format
1962
+ */
1963
+ api_version: string;
1964
+ /**
1965
+ * When the event was created
1966
+ */
1967
+ created_at: string;
1968
+ /**
1969
+ * Payload for poll.vote.added and poll.vote.removed (one option toggled).
1970
+ */
1971
+ data: PollVoteRemovedWebhookEvent.Data;
1972
+ /**
1973
+ * Unique identifier for this event (for deduplication)
1974
+ */
1975
+ event_id: string;
1976
+ /**
1977
+ * Valid webhook event types that can be subscribed to.
1978
+ *
1979
+ * **Note:** `message.edited` is only delivered to subscriptions using
1980
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
1981
+ * subscription will not produce any deliveries.
1982
+ */
1983
+ event_type: WebhookEventsAPI.WebhookEventType;
1984
+ /**
1985
+ * Partner identifier. Present on all webhooks for cross-referencing.
1986
+ */
1987
+ partner_id: string;
1988
+ /**
1989
+ * Trace ID for debugging and correlation across systems.
1990
+ */
1991
+ trace_id: string;
1992
+ /**
1993
+ * Date-based webhook payload version. Determined by the `?version=` query
1994
+ * parameter in your webhook subscription URL. If no version parameter is
1995
+ * specified, defaults based on subscription creation date.
1996
+ */
1997
+ webhook_version: string;
1998
+ }
1999
+ export declare namespace PollVoteRemovedWebhookEvent {
2000
+ /**
2001
+ * Payload for poll.vote.added and poll.vote.removed (one option toggled).
2002
+ */
2003
+ interface Data {
2004
+ /**
2005
+ * Chat info for poll webhook events.
2006
+ */
2007
+ chat: Data.Chat;
2008
+ direction: 'inbound' | 'outbound';
2009
+ message_id: string;
2010
+ option_id: string;
2011
+ /**
2012
+ * The voter — always present.
2013
+ */
2014
+ sender_handle: Shared.ChatHandle;
2015
+ service: string;
2016
+ }
2017
+ namespace Data {
2018
+ /**
2019
+ * Chat info for poll webhook events.
2020
+ */
2021
+ interface Chat {
2022
+ id: string;
2023
+ is_group?: boolean | null;
2024
+ owner_handle?: Shared.ChatHandle | null;
2025
+ }
2026
+ }
2027
+ }
2028
+ /**
2029
+ * Complete webhook payload for poll.reaction.added events
2030
+ */
2031
+ export interface PollReactionAddedWebhookEvent {
2032
+ /**
2033
+ * API version for the webhook payload format
2034
+ */
2035
+ api_version: string;
2036
+ /**
2037
+ * When the event was created
2038
+ */
2039
+ created_at: string;
2040
+ /**
2041
+ * Payload for poll.reaction.added — a reaction on a poll message. Same shape as
2042
+ * reaction.added; `message_id` is the poll-definition message's ID. Poll reactions
2043
+ * are stickers, which iMessage cannot remove, so there is no removal counterpart.
2044
+ */
2045
+ data: ReactionEventBase;
2046
+ /**
2047
+ * Unique identifier for this event (for deduplication)
2048
+ */
2049
+ event_id: string;
2050
+ /**
2051
+ * Valid webhook event types that can be subscribed to.
2052
+ *
2053
+ * **Note:** `message.edited` is only delivered to subscriptions using
2054
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
2055
+ * subscription will not produce any deliveries.
2056
+ */
2057
+ event_type: WebhookEventsAPI.WebhookEventType;
2058
+ /**
2059
+ * Partner identifier. Present on all webhooks for cross-referencing.
2060
+ */
2061
+ partner_id: string;
2062
+ /**
2063
+ * Trace ID for debugging and correlation across systems.
2064
+ */
2065
+ trace_id: string;
2066
+ /**
2067
+ * Date-based webhook payload version. Determined by the `?version=` query
2068
+ * parameter in your webhook subscription URL. If no version parameter is
2069
+ * specified, defaults based on subscription creation date.
2070
+ */
2071
+ webhook_version: string;
2072
+ }
2073
+ /**
2074
+ * Complete webhook payload for participant.added events
2075
+ */
2076
+ export interface ParticipantAddedWebhookEvent {
2077
+ /**
2078
+ * API version for the webhook payload format
2079
+ */
2080
+ api_version: string;
2081
+ /**
2082
+ * When the event was created
2083
+ */
2084
+ created_at: string;
2085
+ /**
2086
+ * Payload for participant.added webhook events
2087
+ */
2088
+ data: ParticipantAddedWebhookEvent.Data;
2089
+ /**
2090
+ * Unique identifier for this event (for deduplication)
2091
+ */
2092
+ event_id: string;
2093
+ /**
2094
+ * Valid webhook event types that can be subscribed to.
2095
+ *
2096
+ * **Note:** `message.edited` is only delivered to subscriptions using
2097
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
2098
+ * subscription will not produce any deliveries.
2099
+ */
2100
+ event_type: WebhookEventsAPI.WebhookEventType;
2101
+ /**
2102
+ * Partner identifier. Present on all webhooks for cross-referencing.
2103
+ */
2104
+ partner_id: string;
2105
+ /**
2106
+ * Trace ID for debugging and correlation across systems.
2107
+ */
2108
+ trace_id: string;
2109
+ /**
2110
+ * Date-based webhook payload version. Determined by the `?version=` query
2111
+ * parameter in your webhook subscription URL. If no version parameter is
2112
+ * specified, defaults based on subscription creation date.
2113
+ */
2114
+ webhook_version: string;
2115
+ }
2116
+ export declare namespace ParticipantAddedWebhookEvent {
2117
+ /**
2118
+ * Payload for participant.added webhook events
2119
+ */
2120
+ interface Data {
2121
+ /**
2122
+ * @deprecated DEPRECATED: Use participant instead. Handle (phone number or email
2123
+ * address) of the added participant.
2124
+ */
2125
+ handle: string;
2126
+ /**
2127
+ * When the participant was added
2128
+ */
2129
+ added_at?: string;
2130
+ /**
2131
+ * Chat identifier (UUID) of the group chat
2132
+ */
2133
+ chat_id?: string;
2134
+ /**
2135
+ * The added participant as a full handle object
2136
+ */
2137
+ participant?: Shared.ChatHandle;
2138
+ }
2139
+ }
2140
+ /**
2141
+ * Complete webhook payload for participant.removed events
2142
+ */
2143
+ export interface ParticipantRemovedWebhookEvent {
2144
+ /**
2145
+ * API version for the webhook payload format
2146
+ */
2147
+ api_version: string;
2148
+ /**
2149
+ * When the event was created
2150
+ */
2151
+ created_at: string;
2152
+ /**
2153
+ * Payload for participant.removed webhook events
2154
+ */
2155
+ data: ParticipantRemovedWebhookEvent.Data;
2156
+ /**
2157
+ * Unique identifier for this event (for deduplication)
2158
+ */
2159
+ event_id: string;
2160
+ /**
2161
+ * Valid webhook event types that can be subscribed to.
2162
+ *
2163
+ * **Note:** `message.edited` is only delivered to subscriptions using
2164
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
2165
+ * subscription will not produce any deliveries.
2166
+ */
2167
+ event_type: WebhookEventsAPI.WebhookEventType;
2168
+ /**
2169
+ * Partner identifier. Present on all webhooks for cross-referencing.
2170
+ */
2171
+ partner_id: string;
2172
+ /**
2173
+ * Trace ID for debugging and correlation across systems.
2174
+ */
2175
+ trace_id: string;
2176
+ /**
2177
+ * Date-based webhook payload version. Determined by the `?version=` query
2178
+ * parameter in your webhook subscription URL. If no version parameter is
2179
+ * specified, defaults based on subscription creation date.
2180
+ */
2181
+ webhook_version: string;
2182
+ }
2183
+ export declare namespace ParticipantRemovedWebhookEvent {
2184
+ /**
2185
+ * Payload for participant.removed webhook events
2186
+ */
2187
+ interface Data {
2188
+ /**
2189
+ * @deprecated DEPRECATED: Use participant instead. Handle (phone number or email
2190
+ * address) of the removed participant.
2191
+ */
2192
+ handle: string;
2193
+ /**
2194
+ * Chat identifier (UUID) of the group chat
2195
+ */
2196
+ chat_id?: string;
2197
+ /**
2198
+ * The removed participant as a full handle object
2199
+ */
2200
+ participant?: Shared.ChatHandle;
2201
+ /**
2202
+ * When the participant was removed
2203
+ */
2204
+ removed_at?: string;
2205
+ }
2206
+ }
2207
+ /**
2208
+ * Complete webhook payload for chat.created events
2209
+ */
2210
+ export interface ChatCreatedWebhookEvent {
2211
+ /**
2212
+ * API version for the webhook payload format
2213
+ */
2214
+ api_version: string;
2215
+ /**
2216
+ * When the event was created
2217
+ */
2218
+ created_at: string;
2219
+ /**
2220
+ * Payload for chat.created webhook events. Matches GET /v3/chats/{chatId}
2221
+ * response.
2222
+ */
2223
+ data: ChatCreatedWebhookEvent.Data;
2224
+ /**
2225
+ * Unique identifier for this event (for deduplication)
2226
+ */
2227
+ event_id: string;
2228
+ /**
2229
+ * Valid webhook event types that can be subscribed to.
2230
+ *
2231
+ * **Note:** `message.edited` is only delivered to subscriptions using
2232
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
2233
+ * subscription will not produce any deliveries.
2234
+ */
2235
+ event_type: WebhookEventsAPI.WebhookEventType;
2236
+ /**
2237
+ * Partner identifier. Present on all webhooks for cross-referencing.
2238
+ */
2239
+ partner_id: string;
2240
+ /**
2241
+ * Trace ID for debugging and correlation across systems.
2242
+ */
2243
+ trace_id: string;
2244
+ /**
2245
+ * Date-based webhook payload version. Determined by the `?version=` query
2246
+ * parameter in your webhook subscription URL. If no version parameter is
2247
+ * specified, defaults based on subscription creation date.
2248
+ */
2249
+ webhook_version: string;
2250
+ }
2251
+ export declare namespace ChatCreatedWebhookEvent {
2252
+ /**
2253
+ * Payload for chat.created webhook events. Matches GET /v3/chats/{chatId}
2254
+ * response.
2255
+ */
2256
+ interface Data {
2257
+ /**
2258
+ * Unique identifier for the chat
2259
+ */
2260
+ id: string;
2261
+ /**
2262
+ * When the chat was created
2263
+ */
2264
+ created_at: string;
2265
+ /**
2266
+ * Display name for the chat. Defaults to a comma-separated list of recipient
2267
+ * handles. Can be updated for group chats.
2268
+ */
2269
+ display_name: string | null;
2270
+ /**
2271
+ * List of chat participants with full handle details. Always contains at least two
2272
+ * handles (your phone number and the other participant).
2273
+ */
2274
+ handles: Array<Shared.ChatHandle>;
2275
+ /**
2276
+ * **[BETA]** Current health for a chat. Always present — chats start at `HEALTHY`
2277
+ * and may shift based on engagement and delivery signals on the conversation. Many
2278
+ * `AT_RISK` or `CRITICAL` chats on a single line increase the risk of line
2279
+ * flagging.
2280
+ *
2281
+ * Switch on `status` to surface chat and line health in your UI — the enum is the
2282
+ * long-term contract. Each status carries a `doc_url` that deep-links to the
2283
+ * relevant section of the Chat Health guide. To gate a send, act on the response
2284
+ * rather than the status: a `403` is the authoritative answer.
2285
+ *
2286
+ * See the [Chat Health guide](/guides/chats/chat-health) for what each status
2287
+ * means and how to react.
2288
+ */
2289
+ health_status: Data.HealthStatus;
2290
+ /**
2291
+ * Whether this is a group chat
2292
+ */
2293
+ is_group: boolean;
2294
+ /**
2295
+ * When the chat was last updated
2296
+ */
2297
+ updated_at: string;
2298
+ /**
2299
+ * Messaging service type
2300
+ */
2301
+ service?: Shared.ServiceType | null;
2302
+ }
2303
+ namespace Data {
2304
+ /**
2305
+ * **[BETA]** Current health for a chat. Always present — chats start at `HEALTHY`
2306
+ * and may shift based on engagement and delivery signals on the conversation. Many
2307
+ * `AT_RISK` or `CRITICAL` chats on a single line increase the risk of line
2308
+ * flagging.
2309
+ *
2310
+ * Switch on `status` to surface chat and line health in your UI — the enum is the
2311
+ * long-term contract. Each status carries a `doc_url` that deep-links to the
2312
+ * relevant section of the Chat Health guide. To gate a send, act on the response
2313
+ * rather than the status: a `403` is the authoritative answer.
2314
+ *
2315
+ * See the [Chat Health guide](/guides/chats/chat-health) for what each status
2316
+ * means and how to react.
2317
+ */
2318
+ interface HealthStatus {
2319
+ /**
2320
+ * Deep-link to the relevant section of the Chat Health guide for this status.
2321
+ */
2322
+ doc_url: string;
2323
+ /**
2324
+ * Current health bucket for the chat. See the
2325
+ * [Chat Health guide](/guides/chats/chat-health) for what each value means and how
2326
+ * to react. `doc_url` deep-links to the relevant section.
2327
+ *
2328
+ * `OPTED_OUT` — the recipient sent `STOP`, `UNSUBSCRIBE`, `OPTOUT`, `CANCEL`,
2329
+ * `END`, or `QUIT`. The keyword must be the whole trimmed message, never part of a
2330
+ * longer one: `STOP` counts, `please stop` does not. Most keywords must match
2331
+ * exactly, including case. `OPT OUT` is the exception — it matches in any casing,
2332
+ * with or without the space or a hyphen, so `opt out`, `Opt-Out` and `optout` all
2333
+ * count. It clears as soon as they reply again: any later message from them that
2334
+ * is not itself an opt-out keyword opts them back in immediately — a reply in any
2335
+ * conversation with you counts, the same way the block does.
2336
+ *
2337
+ * `OPTED_OUT` marks only the conversation the keyword arrived in. The block below
2338
+ * is wider than the mark, so a conversation still reading `HEALTHY` can be blocked
2339
+ * as well — gate on the `403`, not on the status. Group threads are never marked
2340
+ * and are never blocked.
2341
+ *
2342
+ * Linq enforces this: while a recipient is opted out, every send to them is
2343
+ * rejected with `403` (error code `2024`) before the message is queued, across
2344
+ * every chat and every line on your account. Nothing is delivered, including a
2345
+ * final courtesy message — to send one, set `override_optout: true` on that single
2346
+ * request.
2347
+ */
2348
+ status: 'HEALTHY' | 'AT_RISK' | 'CRITICAL' | 'OPTED_OUT';
2349
+ /**
2350
+ * When this status last changed.
2351
+ */
2352
+ updated_at: string;
2353
+ }
2354
+ }
2355
+ }
2356
+ /**
2357
+ * Complete webhook payload for chat.group_name_updated events
2358
+ */
2359
+ export interface ChatGroupNameUpdatedWebhookEvent {
2360
+ /**
2361
+ * API version for the webhook payload format
2362
+ */
2363
+ api_version: string;
2364
+ /**
2365
+ * When the event was created
2366
+ */
2367
+ created_at: string;
2368
+ /**
2369
+ * Payload for chat.group_name_updated webhook events
2370
+ */
2371
+ data: ChatGroupNameUpdatedWebhookEvent.Data;
2372
+ /**
2373
+ * Unique identifier for this event (for deduplication)
2374
+ */
2375
+ event_id: string;
2376
+ /**
2377
+ * Valid webhook event types that can be subscribed to.
2378
+ *
2379
+ * **Note:** `message.edited` is only delivered to subscriptions using
2380
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
2381
+ * subscription will not produce any deliveries.
2382
+ */
2383
+ event_type: WebhookEventsAPI.WebhookEventType;
2384
+ /**
2385
+ * Partner identifier. Present on all webhooks for cross-referencing.
2386
+ */
2387
+ partner_id: string;
2388
+ /**
2389
+ * Trace ID for debugging and correlation across systems.
2390
+ */
2391
+ trace_id: string;
2392
+ /**
2393
+ * Date-based webhook payload version. Determined by the `?version=` query
2394
+ * parameter in your webhook subscription URL. If no version parameter is
2395
+ * specified, defaults based on subscription creation date.
2396
+ */
2397
+ webhook_version: string;
2398
+ }
2399
+ export declare namespace ChatGroupNameUpdatedWebhookEvent {
2400
+ /**
2401
+ * Payload for chat.group_name_updated webhook events
2402
+ */
2403
+ interface Data {
2404
+ /**
2405
+ * Chat identifier (UUID) of the group chat
2406
+ */
2407
+ chat_id: string;
2408
+ /**
2409
+ * When the update occurred
2410
+ */
2411
+ updated_at: string;
2412
+ /**
2413
+ * The handle who made the change.
2414
+ */
2415
+ changed_by_handle?: Shared.ChatHandle | null;
2416
+ /**
2417
+ * New group name (null if the name was removed)
2418
+ */
2419
+ new_value?: string | null;
2420
+ /**
2421
+ * Previous group name (null if no previous name)
2422
+ */
2423
+ old_value?: string | null;
2424
+ }
2425
+ }
2426
+ /**
2427
+ * Complete webhook payload for chat.group_icon_updated events
2428
+ */
2429
+ export interface ChatGroupIconUpdatedWebhookEvent {
2430
+ /**
2431
+ * API version for the webhook payload format
2432
+ */
2433
+ api_version: string;
2434
+ /**
2435
+ * When the event was created
2436
+ */
2437
+ created_at: string;
2438
+ /**
2439
+ * Payload for chat.group_icon_updated webhook events
2440
+ */
2441
+ data: ChatGroupIconUpdatedWebhookEvent.Data;
2442
+ /**
2443
+ * Unique identifier for this event (for deduplication)
2444
+ */
2445
+ event_id: string;
2446
+ /**
2447
+ * Valid webhook event types that can be subscribed to.
2448
+ *
2449
+ * **Note:** `message.edited` is only delivered to subscriptions using
2450
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
2451
+ * subscription will not produce any deliveries.
2452
+ */
2453
+ event_type: WebhookEventsAPI.WebhookEventType;
2454
+ /**
2455
+ * Partner identifier. Present on all webhooks for cross-referencing.
2456
+ */
2457
+ partner_id: string;
2458
+ /**
2459
+ * Trace ID for debugging and correlation across systems.
2460
+ */
2461
+ trace_id: string;
2462
+ /**
2463
+ * Date-based webhook payload version. Determined by the `?version=` query
2464
+ * parameter in your webhook subscription URL. If no version parameter is
2465
+ * specified, defaults based on subscription creation date.
2466
+ */
2467
+ webhook_version: string;
2468
+ }
2469
+ export declare namespace ChatGroupIconUpdatedWebhookEvent {
2470
+ /**
2471
+ * Payload for chat.group_icon_updated webhook events
2472
+ */
2473
+ interface Data {
2474
+ /**
2475
+ * Chat identifier (UUID) of the group chat
2476
+ */
2477
+ chat_id: string;
2478
+ /**
2479
+ * When the update occurred
2480
+ */
2481
+ updated_at: string;
2482
+ /**
2483
+ * The handle who made the change.
2484
+ */
2485
+ changed_by_handle?: Shared.ChatHandle | null;
2486
+ /**
2487
+ * New icon URL (null if the icon was removed)
2488
+ */
2489
+ new_value?: string | null;
2490
+ /**
2491
+ * Previous icon URL (null if no previous icon)
2492
+ */
2493
+ old_value?: string | null;
2494
+ }
2495
+ }
2496
+ /**
2497
+ * Complete webhook payload for chat.group_name_update_failed events
2498
+ */
2499
+ export interface ChatGroupNameUpdateFailedWebhookEvent {
2500
+ /**
2501
+ * API version for the webhook payload format
2502
+ */
2503
+ api_version: string;
2504
+ /**
2505
+ * When the event was created
2506
+ */
2507
+ created_at: string;
2508
+ /**
2509
+ * Error details for chat.group_name_update_failed webhook events. See
2510
+ * [WebhookErrorCode](#/components/schemas/WebhookErrorCode) for the full error
2511
+ * code reference.
2512
+ */
2513
+ data: ChatGroupNameUpdateFailedWebhookEvent.Data;
2514
+ /**
2515
+ * Unique identifier for this event (for deduplication)
2516
+ */
2517
+ event_id: string;
2518
+ /**
2519
+ * Valid webhook event types that can be subscribed to.
2520
+ *
2521
+ * **Note:** `message.edited` is only delivered to subscriptions using
2522
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
2523
+ * subscription will not produce any deliveries.
2524
+ */
2525
+ event_type: WebhookEventsAPI.WebhookEventType;
2526
+ /**
2527
+ * Partner identifier. Present on all webhooks for cross-referencing.
2528
+ */
2529
+ partner_id: string;
2530
+ /**
2531
+ * Trace ID for debugging and correlation across systems.
2532
+ */
2533
+ trace_id: string;
2534
+ /**
2535
+ * Date-based webhook payload version. Determined by the `?version=` query
2536
+ * parameter in your webhook subscription URL. If no version parameter is
2537
+ * specified, defaults based on subscription creation date.
2538
+ */
2539
+ webhook_version: string;
2540
+ }
2541
+ export declare namespace ChatGroupNameUpdateFailedWebhookEvent {
2542
+ /**
2543
+ * Error details for chat.group_name_update_failed webhook events. See
2544
+ * [WebhookErrorCode](#/components/schemas/WebhookErrorCode) for the full error
2545
+ * code reference.
2546
+ */
2547
+ interface Data {
2548
+ /**
2549
+ * Chat identifier (UUID) of the group chat
2550
+ */
2551
+ chat_id: string;
2552
+ /**
2553
+ * Error codes in webhook failure events. The possible set varies by event:
2554
+ * message.failed and poll.failed can carry 3007, 4001, 4002, 4005, 4006, 4007, or
2555
+ * 4008; the group update failure events (chat.group_name_update_failed,
2556
+ * chat.group_icon_update_failed) carry 3007 or 4001; chat.background_update_failed
2557
+ * carries 1005, 2011, 4001, or 5002.
2558
+ */
2559
+ error_code: number;
2560
+ /**
2561
+ * When the failure was detected
2562
+ */
2563
+ failed_at: string;
2564
+ }
2565
+ }
2566
+ /**
2567
+ * Complete webhook payload for chat.group_icon_update_failed events
2568
+ */
2569
+ export interface ChatGroupIconUpdateFailedWebhookEvent {
2570
+ /**
2571
+ * API version for the webhook payload format
2572
+ */
2573
+ api_version: string;
2574
+ /**
2575
+ * When the event was created
2576
+ */
2577
+ created_at: string;
2578
+ /**
2579
+ * Error details for chat.group_icon_update_failed webhook events. See
2580
+ * [WebhookErrorCode](#/components/schemas/WebhookErrorCode) for the full error
2581
+ * code reference.
2582
+ */
2583
+ data: ChatGroupIconUpdateFailedWebhookEvent.Data;
2584
+ /**
2585
+ * Unique identifier for this event (for deduplication)
2586
+ */
2587
+ event_id: string;
2588
+ /**
2589
+ * Valid webhook event types that can be subscribed to.
2590
+ *
2591
+ * **Note:** `message.edited` is only delivered to subscriptions using
2592
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
2593
+ * subscription will not produce any deliveries.
2594
+ */
2595
+ event_type: WebhookEventsAPI.WebhookEventType;
2596
+ /**
2597
+ * Partner identifier. Present on all webhooks for cross-referencing.
2598
+ */
2599
+ partner_id: string;
2600
+ /**
2601
+ * Trace ID for debugging and correlation across systems.
2602
+ */
2603
+ trace_id: string;
2604
+ /**
2605
+ * Date-based webhook payload version. Determined by the `?version=` query
2606
+ * parameter in your webhook subscription URL. If no version parameter is
2607
+ * specified, defaults based on subscription creation date.
2608
+ */
2609
+ webhook_version: string;
2610
+ }
2611
+ export declare namespace ChatGroupIconUpdateFailedWebhookEvent {
2612
+ /**
2613
+ * Error details for chat.group_icon_update_failed webhook events. See
2614
+ * [WebhookErrorCode](#/components/schemas/WebhookErrorCode) for the full error
2615
+ * code reference.
2616
+ */
2617
+ interface Data {
2618
+ /**
2619
+ * Chat identifier (UUID) of the group chat
2620
+ */
2621
+ chat_id: string;
2622
+ /**
2623
+ * Error codes in webhook failure events. The possible set varies by event:
2624
+ * message.failed and poll.failed can carry 3007, 4001, 4002, 4005, 4006, 4007, or
2625
+ * 4008; the group update failure events (chat.group_name_update_failed,
2626
+ * chat.group_icon_update_failed) carry 3007 or 4001; chat.background_update_failed
2627
+ * carries 1005, 2011, 4001, or 5002.
2628
+ */
2629
+ error_code: number;
2630
+ /**
2631
+ * When the failure was detected
2632
+ */
2633
+ failed_at: string;
2634
+ }
2635
+ }
2636
+ /**
2637
+ * Complete webhook payload for chat.typing_indicator.started events
2638
+ */
2639
+ export interface ChatTypingIndicatorStartedWebhookEvent {
2640
+ /**
2641
+ * API version for the webhook payload format
2642
+ */
2643
+ api_version: string;
2644
+ /**
2645
+ * When the event was created
2646
+ */
2647
+ created_at: string;
2648
+ /**
2649
+ * Payload for chat.typing_indicator.started webhook events
2650
+ */
2651
+ data: ChatTypingIndicatorStartedWebhookEvent.Data;
2652
+ /**
2653
+ * Unique identifier for this event (for deduplication)
2654
+ */
2655
+ event_id: string;
2656
+ /**
2657
+ * Valid webhook event types that can be subscribed to.
2658
+ *
2659
+ * **Note:** `message.edited` is only delivered to subscriptions using
2660
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
2661
+ * subscription will not produce any deliveries.
2662
+ */
2663
+ event_type: WebhookEventsAPI.WebhookEventType;
2664
+ /**
2665
+ * Partner identifier. Present on all webhooks for cross-referencing.
2666
+ */
2667
+ partner_id: string;
2668
+ /**
2669
+ * Trace ID for debugging and correlation across systems.
2670
+ */
2671
+ trace_id: string;
2672
+ /**
2673
+ * Date-based webhook payload version. Determined by the `?version=` query
2674
+ * parameter in your webhook subscription URL. If no version parameter is
2675
+ * specified, defaults based on subscription creation date.
2676
+ */
2677
+ webhook_version: string;
2678
+ }
2679
+ export declare namespace ChatTypingIndicatorStartedWebhookEvent {
2680
+ /**
2681
+ * Payload for chat.typing_indicator.started webhook events
2682
+ */
2683
+ interface Data {
2684
+ /**
2685
+ * Chat identifier
2686
+ */
2687
+ chat_id: string;
2688
+ }
2689
+ }
2690
+ /**
2691
+ * Complete webhook payload for chat.typing_indicator.stopped events
2692
+ */
2693
+ export interface ChatTypingIndicatorStoppedWebhookEvent {
2694
+ /**
2695
+ * API version for the webhook payload format
2696
+ */
2697
+ api_version: string;
2698
+ /**
2699
+ * When the event was created
2700
+ */
2701
+ created_at: string;
2702
+ /**
2703
+ * Payload for chat.typing_indicator.stopped webhook events
2704
+ */
2705
+ data: ChatTypingIndicatorStoppedWebhookEvent.Data;
2706
+ /**
2707
+ * Unique identifier for this event (for deduplication)
2708
+ */
2709
+ event_id: string;
2710
+ /**
2711
+ * Valid webhook event types that can be subscribed to.
2712
+ *
2713
+ * **Note:** `message.edited` is only delivered to subscriptions using
2714
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
2715
+ * subscription will not produce any deliveries.
2716
+ */
2717
+ event_type: WebhookEventsAPI.WebhookEventType;
2718
+ /**
2719
+ * Partner identifier. Present on all webhooks for cross-referencing.
2720
+ */
2721
+ partner_id: string;
2722
+ /**
2723
+ * Trace ID for debugging and correlation across systems.
2724
+ */
2725
+ trace_id: string;
2726
+ /**
2727
+ * Date-based webhook payload version. Determined by the `?version=` query
2728
+ * parameter in your webhook subscription URL. If no version parameter is
2729
+ * specified, defaults based on subscription creation date.
2730
+ */
2731
+ webhook_version: string;
2732
+ }
2733
+ export declare namespace ChatTypingIndicatorStoppedWebhookEvent {
2734
+ /**
2735
+ * Payload for chat.typing_indicator.stopped webhook events
2736
+ */
2737
+ interface Data {
2738
+ /**
2739
+ * Chat identifier
2740
+ */
2741
+ chat_id: string;
2742
+ }
2743
+ }
2744
+ /**
2745
+ * Complete webhook payload for chat.background_updated events
2746
+ */
2747
+ export interface ChatBackgroundUpdatedWebhookEvent {
2748
+ /**
2749
+ * API version for the webhook payload format
2750
+ */
2751
+ api_version: string;
2752
+ /**
2753
+ * When the event was created
2754
+ */
2755
+ created_at: string;
2756
+ /**
2757
+ * Payload for chat.background_updated webhook events.
2758
+ */
2759
+ data: ChatBackgroundUpdatedWebhookEvent.Data;
2760
+ /**
2761
+ * Unique identifier for this event (for deduplication)
2762
+ */
2763
+ event_id: string;
2764
+ /**
2765
+ * Valid webhook event types that can be subscribed to.
2766
+ *
2767
+ * **Note:** `message.edited` is only delivered to subscriptions using
2768
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
2769
+ * subscription will not produce any deliveries.
2770
+ */
2771
+ event_type: WebhookEventsAPI.WebhookEventType;
2772
+ /**
2773
+ * Partner identifier. Present on all webhooks for cross-referencing.
2774
+ */
2775
+ partner_id: string;
2776
+ /**
2777
+ * Trace ID for debugging and correlation across systems.
2778
+ */
2779
+ trace_id: string;
2780
+ /**
2781
+ * Date-based webhook payload version. Determined by the `?version=` query
2782
+ * parameter in your webhook subscription URL. If no version parameter is
2783
+ * specified, defaults based on subscription creation date.
2784
+ */
2785
+ webhook_version: string;
2786
+ }
2787
+ export declare namespace ChatBackgroundUpdatedWebhookEvent {
2788
+ /**
2789
+ * Payload for chat.background_updated webhook events.
2790
+ */
2791
+ interface Data {
2792
+ /**
2793
+ * Chat information
2794
+ */
2795
+ chat: Data.Chat;
2796
+ /**
2797
+ * Who changed it. `is_me` is true when your own number set it.
2798
+ */
2799
+ actor_handle?: Shared.ChatHandle | null;
2800
+ /**
2801
+ * A chat transcript background. Fields are populated per `type`.
2802
+ */
2803
+ background?: Data.Background | null;
2804
+ }
2805
+ namespace Data {
2806
+ /**
2807
+ * Chat information
2808
+ */
2809
+ interface Chat {
2810
+ /**
2811
+ * Chat identifier
2812
+ */
2813
+ id: string;
2814
+ /**
2815
+ * Whether this is a group chat
2816
+ */
2817
+ is_group?: boolean | null;
2818
+ /**
2819
+ * Your phone number's handle. Always has is_me=true.
2820
+ */
2821
+ owner_handle?: Shared.ChatHandle | null;
2822
+ }
2823
+ /**
2824
+ * A chat transcript background. Fields are populated per `type`.
2825
+ */
2826
+ interface Background {
2827
+ /**
2828
+ * The background family.
2829
+ */
2830
+ type: 'color' | 'dynamic' | 'photo';
2831
+ /**
2832
+ * Photo: a hosted URL for the background image, whether you set it or a
2833
+ * participant did. Apple stores the image, not the URL it came from, so the image
2834
+ * is re-hosted and this is our URL rather than the one you supplied. `null` only
2835
+ * if the image could not be hosted.
2836
+ */
2837
+ image_url?: string | null;
2838
+ /**
2839
+ * Color: the two gradient stops as hex, top then bottom.
2840
+ */
2841
+ shades?: Array<string> | null;
2842
+ /**
2843
+ * Dynamic: the animated style.
2844
+ */
2845
+ style?: 'sky' | 'water' | 'aurora' | 'glitter' | null;
2846
+ /**
2847
+ * Color: `custom` (the stored two colors) or a named swatch. Dynamic: the variant
2848
+ * within the `style` (e.g. `sunrise`).
2849
+ */
2850
+ variant?: string | null;
2851
+ }
2852
+ }
2853
+ }
2854
+ /**
2855
+ * Complete webhook payload for chat.background_update_failed events
2856
+ */
2857
+ export interface ChatBackgroundUpdateFailedWebhookEvent {
2858
+ /**
2859
+ * API version for the webhook payload format
2860
+ */
2861
+ api_version: string;
2862
+ /**
2863
+ * When the event was created
2864
+ */
2865
+ created_at: string;
2866
+ /**
2867
+ * Error details for chat.background_update_failed webhook events. See
2868
+ * [WebhookErrorCode](#/components/schemas/WebhookErrorCode) for the full error
2869
+ * code reference.
2870
+ */
2871
+ data: ChatBackgroundUpdateFailedWebhookEvent.Data;
2872
+ /**
2873
+ * Unique identifier for this event (for deduplication)
2874
+ */
2875
+ event_id: string;
2876
+ /**
2877
+ * Valid webhook event types that can be subscribed to.
2878
+ *
2879
+ * **Note:** `message.edited` is only delivered to subscriptions using
2880
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
2881
+ * subscription will not produce any deliveries.
2882
+ */
2883
+ event_type: WebhookEventsAPI.WebhookEventType;
2884
+ /**
2885
+ * Partner identifier. Present on all webhooks for cross-referencing.
2886
+ */
2887
+ partner_id: string;
2888
+ /**
2889
+ * Trace ID for debugging and correlation across systems.
2890
+ */
2891
+ trace_id: string;
2892
+ /**
2893
+ * Date-based webhook payload version. Determined by the `?version=` query
2894
+ * parameter in your webhook subscription URL. If no version parameter is
2895
+ * specified, defaults based on subscription creation date.
2896
+ */
2897
+ webhook_version: string;
2898
+ }
2899
+ export declare namespace ChatBackgroundUpdateFailedWebhookEvent {
2900
+ /**
2901
+ * Error details for chat.background_update_failed webhook events. See
2902
+ * [WebhookErrorCode](#/components/schemas/WebhookErrorCode) for the full error
2903
+ * code reference.
2904
+ */
2905
+ interface Data {
2906
+ /**
2907
+ * Chat identifier (UUID) whose background update failed
2908
+ */
2909
+ chat_id: string;
2910
+ /**
2911
+ * Error codes in webhook failure events. The possible set varies by event:
2912
+ * message.failed and poll.failed can carry 3007, 4001, 4002, 4005, 4006, 4007, or
2913
+ * 4008; the group update failure events (chat.group_name_update_failed,
2914
+ * chat.group_icon_update_failed) carry 3007 or 4001; chat.background_update_failed
2915
+ * carries 1005, 2011, 4001, or 5002.
2916
+ */
2917
+ error_code: number;
2918
+ /**
2919
+ * When the failure was detected
2920
+ */
2921
+ failed_at: string;
2922
+ }
2923
+ }
2924
+ /**
2925
+ * Complete webhook payload for phone_number.status_updated events
2926
+ */
2927
+ export interface PhoneNumberStatusUpdatedWebhookEvent {
2928
+ /**
2929
+ * API version for the webhook payload format
2930
+ */
2931
+ api_version: string;
2932
+ /**
2933
+ * When the event was created
2934
+ */
2935
+ created_at: string;
2936
+ /**
2937
+ * Payload for phone_number.status_updated webhook events
2938
+ */
2939
+ data: PhoneNumberStatusUpdatedWebhookEvent.Data;
2940
+ /**
2941
+ * Unique identifier for this event (for deduplication)
2942
+ */
2943
+ event_id: string;
2944
+ /**
2945
+ * The type of event
2946
+ */
2947
+ event_type: 'message.sent' | 'message.received' | 'message.read' | 'message.delivered' | 'message.failed' | 'message.edited' | 'reaction.added' | 'reaction.removed' | 'poll.received' | 'poll.failed' | 'poll.sent' | 'poll.delivered' | 'poll.read' | 'poll.updated' | 'poll.vote.added' | 'poll.vote.removed' | 'poll.reaction.added' | 'participant.added' | 'participant.removed' | 'chat.created' | 'chat.group_name_updated' | 'chat.group_icon_updated' | 'chat.group_name_update_failed' | 'chat.group_icon_update_failed' | 'chat.background_updated' | 'chat.background_update_failed' | 'chat.typing_indicator.started' | 'chat.typing_indicator.stopped' | 'phone_number.status_updated' | 'contact_card.received' | 'call.initiated' | 'call.ringing' | 'call.answered' | 'call.ended' | 'call.failed' | 'call.declined' | 'call.no_answer' | 'location.sharing.started' | 'location.sharing.stopped' | 'payment.succeeded' | 'payment.canceled' | 'payment.expired' | 'payment.declined' | 'payment.authorized' | 'connection.created' | 'connection.revoked';
2948
+ /**
2949
+ * Partner identifier. Present on all webhooks for cross-referencing.
2950
+ */
2951
+ partner_id: string;
2952
+ /**
2953
+ * Trace ID for debugging and correlation across systems.
2954
+ */
2955
+ trace_id: string;
2956
+ /**
2957
+ * Date-based webhook payload version. Determined by the `?version=` query
2958
+ * parameter in your webhook subscription URL. If no version parameter is
2959
+ * specified, defaults based on subscription creation date.
2960
+ */
2961
+ webhook_version: string;
2962
+ }
2963
+ export declare namespace PhoneNumberStatusUpdatedWebhookEvent {
2964
+ /**
2965
+ * Payload for phone_number.status_updated webhook events
2966
+ */
2967
+ interface Data {
2968
+ /**
2969
+ * When the status change occurred
2970
+ */
2971
+ changed_at: string;
2972
+ /**
2973
+ * The new line reputation
2974
+ */
2975
+ new_reputation: 'HEALTHY' | 'AT_RISK' | 'CRITICAL';
2976
+ /**
2977
+ * The new service status
2978
+ */
2979
+ new_status: 'ACTIVE' | 'FLAGGED';
2980
+ /**
2981
+ * Phone number in E.164 format
2982
+ */
2983
+ phone_number: string;
2984
+ /**
2985
+ * The previous line reputation
2986
+ */
2987
+ previous_reputation: 'HEALTHY' | 'AT_RISK' | 'CRITICAL';
2988
+ /**
2989
+ * The previous service status
2990
+ */
2991
+ previous_status: 'ACTIVE' | 'FLAGGED';
2992
+ }
2993
+ }
2994
+ /**
2995
+ * Complete webhook payload for message.sent events (2026-02-03 format)
2996
+ */
2997
+ export type UnwrapWebhookEvent = MessageSentWebhookEvent | MessageReceivedWebhookEvent | MessageReadWebhookEvent | MessageDeliveredWebhookEvent | MessageFailedWebhookEvent | MessageEditedWebhookEvent | ReactionAddedWebhookEvent | ReactionRemovedWebhookEvent | PollReceivedWebhookEvent | PollSentWebhookEvent | PollDeliveredWebhookEvent | PollReadWebhookEvent | PollUpdatedWebhookEvent | PollFailedWebhookEvent | PollVoteAddedWebhookEvent | PollVoteRemovedWebhookEvent | PollReactionAddedWebhookEvent | ParticipantAddedWebhookEvent | ParticipantRemovedWebhookEvent | ChatCreatedWebhookEvent | ChatGroupNameUpdatedWebhookEvent | ChatGroupIconUpdatedWebhookEvent | ChatGroupNameUpdateFailedWebhookEvent | ChatGroupIconUpdateFailedWebhookEvent | ChatTypingIndicatorStartedWebhookEvent | ChatTypingIndicatorStoppedWebhookEvent | ChatBackgroundUpdatedWebhookEvent | ChatBackgroundUpdateFailedWebhookEvent | PhoneNumberStatusUpdatedWebhookEvent;
628
2998
  export declare namespace Webhooks {
629
- export { type MessageEventV2 as MessageEventV2, type MessagePayload as MessagePayload, type ReactionEventBase as ReactionEventBase, type SchemasMediaPartResponse as SchemasMediaPartResponse, type SchemasMessageEffect as SchemasMessageEffect, type SchemasTextPartResponse as SchemasTextPartResponse, };
2999
+ export { type MessageEventV2 as MessageEventV2, type MessagePayload as MessagePayload, type ReactionEventBase as ReactionEventBase, type SchemasMediaPartResponse as SchemasMediaPartResponse, type SchemasMessageEffect as SchemasMessageEffect, type SchemasTextPartResponse as SchemasTextPartResponse, type MessageSentWebhookEvent as MessageSentWebhookEvent, type MessageReceivedWebhookEvent as MessageReceivedWebhookEvent, type MessageReadWebhookEvent as MessageReadWebhookEvent, type MessageDeliveredWebhookEvent as MessageDeliveredWebhookEvent, type MessageFailedWebhookEvent as MessageFailedWebhookEvent, type MessageEditedWebhookEvent as MessageEditedWebhookEvent, type ReactionAddedWebhookEvent as ReactionAddedWebhookEvent, type ReactionRemovedWebhookEvent as ReactionRemovedWebhookEvent, type PollReceivedWebhookEvent as PollReceivedWebhookEvent, type PollSentWebhookEvent as PollSentWebhookEvent, type PollDeliveredWebhookEvent as PollDeliveredWebhookEvent, type PollReadWebhookEvent as PollReadWebhookEvent, type PollUpdatedWebhookEvent as PollUpdatedWebhookEvent, type PollFailedWebhookEvent as PollFailedWebhookEvent, type PollVoteAddedWebhookEvent as PollVoteAddedWebhookEvent, type PollVoteRemovedWebhookEvent as PollVoteRemovedWebhookEvent, type PollReactionAddedWebhookEvent as PollReactionAddedWebhookEvent, type ParticipantAddedWebhookEvent as ParticipantAddedWebhookEvent, type ParticipantRemovedWebhookEvent as ParticipantRemovedWebhookEvent, type ChatCreatedWebhookEvent as ChatCreatedWebhookEvent, type ChatGroupNameUpdatedWebhookEvent as ChatGroupNameUpdatedWebhookEvent, type ChatGroupIconUpdatedWebhookEvent as ChatGroupIconUpdatedWebhookEvent, type ChatGroupNameUpdateFailedWebhookEvent as ChatGroupNameUpdateFailedWebhookEvent, type ChatGroupIconUpdateFailedWebhookEvent as ChatGroupIconUpdateFailedWebhookEvent, type ChatTypingIndicatorStartedWebhookEvent as ChatTypingIndicatorStartedWebhookEvent, type ChatTypingIndicatorStoppedWebhookEvent as ChatTypingIndicatorStoppedWebhookEvent, type ChatBackgroundUpdatedWebhookEvent as ChatBackgroundUpdatedWebhookEvent, type ChatBackgroundUpdateFailedWebhookEvent as ChatBackgroundUpdateFailedWebhookEvent, type PhoneNumberStatusUpdatedWebhookEvent as PhoneNumberStatusUpdatedWebhookEvent, type UnwrapWebhookEvent as UnwrapWebhookEvent, };
630
3000
  }
631
3001
  //# sourceMappingURL=webhooks.d.ts.map