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