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