@linqapp/sdk 0.38.1 → 0.39.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 (58) 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 +1 -1
  9. package/resources/chats/background.d.mts +88 -0
  10. package/resources/chats/background.d.mts.map +1 -0
  11. package/resources/chats/background.d.ts +88 -0
  12. package/resources/chats/background.d.ts.map +1 -0
  13. package/resources/chats/background.js +72 -0
  14. package/resources/chats/background.js.map +1 -0
  15. package/resources/chats/background.mjs +68 -0
  16. package/resources/chats/background.mjs.map +1 -0
  17. package/resources/chats/chats.d.mts +4 -0
  18. package/resources/chats/chats.d.mts.map +1 -1
  19. package/resources/chats/chats.d.ts +4 -0
  20. package/resources/chats/chats.d.ts.map +1 -1
  21. package/resources/chats/chats.js +4 -0
  22. package/resources/chats/chats.js.map +1 -1
  23. package/resources/chats/chats.mjs +4 -0
  24. package/resources/chats/chats.mjs.map +1 -1
  25. package/resources/chats/index.d.mts +1 -0
  26. package/resources/chats/index.d.mts.map +1 -1
  27. package/resources/chats/index.d.ts +1 -0
  28. package/resources/chats/index.d.ts.map +1 -1
  29. package/resources/chats/index.js +3 -1
  30. package/resources/chats/index.js.map +1 -1
  31. package/resources/chats/index.mjs +1 -0
  32. package/resources/chats/index.mjs.map +1 -1
  33. package/resources/chats/typing.d.mts +3 -3
  34. package/resources/chats/typing.d.ts +3 -3
  35. package/resources/chats/typing.js +3 -3
  36. package/resources/chats/typing.mjs +3 -3
  37. package/resources/index.d.mts +1 -1
  38. package/resources/index.d.mts.map +1 -1
  39. package/resources/index.d.ts +1 -1
  40. package/resources/index.d.ts.map +1 -1
  41. package/resources/index.js.map +1 -1
  42. package/resources/index.mjs.map +1 -1
  43. package/resources/webhooks.d.mts +929 -8
  44. package/resources/webhooks.d.mts.map +1 -1
  45. package/resources/webhooks.d.ts +929 -8
  46. package/resources/webhooks.d.ts.map +1 -1
  47. package/src/client.ts +20 -0
  48. package/src/resources/chats/background.ts +110 -0
  49. package/src/resources/chats/chats.ts +6 -0
  50. package/src/resources/chats/index.ts +1 -0
  51. package/src/resources/chats/typing.ts +3 -3
  52. package/src/resources/index.ts +10 -0
  53. package/src/resources/webhooks.ts +1184 -6
  54. package/src/version.ts +1 -1
  55. package/version.d.mts +1 -1
  56. package/version.d.ts +1 -1
  57. package/version.js +1 -1
  58. package/version.mjs +1 -1
@@ -1029,8 +1029,8 @@ export namespace MessageFailedWebhookEvent {
1029
1029
  export interface Data {
1030
1030
  /**
1031
1031
  * Error codes in webhook failure events. The possible set varies by event:
1032
- * message.failed can carry 3007, 4001, 4002, 4005, 4006, 4007, or 4008; the group
1033
- * update failure events (chat.group_name_update_failed,
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
1034
  * chat.group_icon_update_failed) carry 3007 or 4001.
1035
1035
  */
1036
1036
  code: number;
@@ -1378,6 +1378,1038 @@ export interface ReactionRemovedWebhookEvent {
1378
1378
  webhook_version: string;
1379
1379
  }
1380
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
+ added_options: Array<Data.AddedOption>;
1984
+
1985
+ /**
1986
+ * Chat info for poll webhook events.
1987
+ */
1988
+ chat: Data.Chat;
1989
+
1990
+ direction: 'inbound' | 'outbound';
1991
+
1992
+ message_id: string;
1993
+
1994
+ /**
1995
+ * The line that added the option(s) — always present.
1996
+ */
1997
+ sender_handle: Shared.ChatHandle;
1998
+
1999
+ service: string;
2000
+ }
2001
+
2002
+ export namespace Data {
2003
+ export interface AddedOption {
2004
+ can_be_edited: boolean;
2005
+
2006
+ /**
2007
+ * The participant who added this option (poll creator for the initial options;
2008
+ * whoever added later ones). Null when unknown.
2009
+ */
2010
+ creator_handle: Shared.ChatHandle;
2011
+
2012
+ option_id: string;
2013
+
2014
+ text: string;
2015
+
2016
+ voters: Array<AddedOption.Voter>;
2017
+ }
2018
+
2019
+ export namespace AddedOption {
2020
+ export interface Voter {
2021
+ handle: string;
2022
+
2023
+ voted_at: string;
2024
+ }
2025
+ }
2026
+
2027
+ /**
2028
+ * Chat info for poll webhook events.
2029
+ */
2030
+ export interface Chat {
2031
+ id: string;
2032
+
2033
+ is_group?: boolean | null;
2034
+
2035
+ owner_handle?: Shared.ChatHandle | null;
2036
+ }
2037
+ }
2038
+ }
2039
+
2040
+ /**
2041
+ * Complete webhook payload for poll.failed events
2042
+ */
2043
+ export interface PollFailedWebhookEvent {
2044
+ /**
2045
+ * API version for the webhook payload format
2046
+ */
2047
+ api_version: string;
2048
+
2049
+ /**
2050
+ * When the event was created
2051
+ */
2052
+ created_at: string;
2053
+
2054
+ /**
2055
+ * Payload for poll.failed — an outbound poll (or poll action) that failed to send.
2056
+ * Carries the poll snapshot at failure time plus the error and when it failed.
2057
+ */
2058
+ data: PollFailedWebhookEvent.Data;
2059
+
2060
+ /**
2061
+ * Unique identifier for this event (for deduplication)
2062
+ */
2063
+ event_id: string;
2064
+
2065
+ /**
2066
+ * Valid webhook event types that can be subscribed to.
2067
+ *
2068
+ * **Note:** `message.edited` is only delivered to subscriptions using
2069
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
2070
+ * subscription will not produce any deliveries.
2071
+ */
2072
+ event_type: WebhookEventsAPI.WebhookEventType;
2073
+
2074
+ /**
2075
+ * Partner identifier. Present on all webhooks for cross-referencing.
2076
+ */
2077
+ partner_id: string;
2078
+
2079
+ /**
2080
+ * Trace ID for debugging and correlation across systems.
2081
+ */
2082
+ trace_id: string;
2083
+
2084
+ /**
2085
+ * Date-based webhook payload version. Determined by the `?version=` query
2086
+ * parameter in your webhook subscription URL. If no version parameter is
2087
+ * specified, defaults based on subscription creation date.
2088
+ */
2089
+ webhook_version: string;
2090
+ }
2091
+
2092
+ export namespace PollFailedWebhookEvent {
2093
+ /**
2094
+ * Payload for poll.failed — an outbound poll (or poll action) that failed to send.
2095
+ * Carries the poll snapshot at failure time plus the error and when it failed.
2096
+ */
2097
+ export interface Data {
2098
+ /**
2099
+ * Chat info for poll webhook events.
2100
+ */
2101
+ chat: Data.Chat;
2102
+
2103
+ direction: 'inbound' | 'outbound';
2104
+
2105
+ error: Data.Error;
2106
+
2107
+ failed_at: string;
2108
+
2109
+ message_id: string;
2110
+
2111
+ poll: Data.Poll;
2112
+
2113
+ service: string;
2114
+
2115
+ /**
2116
+ * Null on failure (the send never landed).
2117
+ */
2118
+ sender_handle?: Shared.ChatHandle | null;
2119
+ }
2120
+
2121
+ export namespace Data {
2122
+ /**
2123
+ * Chat info for poll webhook events.
2124
+ */
2125
+ export interface Chat {
2126
+ id: string;
2127
+
2128
+ is_group?: boolean | null;
2129
+
2130
+ owner_handle?: Shared.ChatHandle | null;
2131
+ }
2132
+
2133
+ export interface Error {
2134
+ /**
2135
+ * Error codes in webhook failure events. The possible set varies by event:
2136
+ * message.failed and poll.failed can carry 3007, 4001, 4002, 4005, 4006, 4007, or
2137
+ * 4008; the group update failure events (chat.group_name_update_failed,
2138
+ * chat.group_icon_update_failed) carry 3007 or 4001.
2139
+ */
2140
+ code: number;
2141
+
2142
+ message: string;
2143
+ }
2144
+
2145
+ export interface Poll {
2146
+ options: Array<Poll.Option>;
2147
+
2148
+ /**
2149
+ * Distinct participants across the whole poll.
2150
+ */
2151
+ total_voters: number;
2152
+ }
2153
+
2154
+ export namespace Poll {
2155
+ export interface Option {
2156
+ can_be_edited: boolean;
2157
+
2158
+ /**
2159
+ * The participant who added this option (poll creator for the initial options;
2160
+ * whoever added later ones). Null when unknown.
2161
+ */
2162
+ creator_handle: Shared.ChatHandle;
2163
+
2164
+ option_id: string;
2165
+
2166
+ text: string;
2167
+
2168
+ voters: Array<Option.Voter>;
2169
+ }
2170
+
2171
+ export namespace Option {
2172
+ export interface Voter {
2173
+ handle: string;
2174
+
2175
+ voted_at: string;
2176
+ }
2177
+ }
2178
+ }
2179
+ }
2180
+ }
2181
+
2182
+ /**
2183
+ * Complete webhook payload for poll.vote.added events
2184
+ */
2185
+ export interface PollVoteAddedWebhookEvent {
2186
+ /**
2187
+ * API version for the webhook payload format
2188
+ */
2189
+ api_version: string;
2190
+
2191
+ /**
2192
+ * When the event was created
2193
+ */
2194
+ created_at: string;
2195
+
2196
+ /**
2197
+ * Payload for poll.vote.added and poll.vote.removed (one option toggled).
2198
+ */
2199
+ data: PollVoteAddedWebhookEvent.Data;
2200
+
2201
+ /**
2202
+ * Unique identifier for this event (for deduplication)
2203
+ */
2204
+ event_id: string;
2205
+
2206
+ /**
2207
+ * Valid webhook event types that can be subscribed to.
2208
+ *
2209
+ * **Note:** `message.edited` is only delivered to subscriptions using
2210
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
2211
+ * subscription will not produce any deliveries.
2212
+ */
2213
+ event_type: WebhookEventsAPI.WebhookEventType;
2214
+
2215
+ /**
2216
+ * Partner identifier. Present on all webhooks for cross-referencing.
2217
+ */
2218
+ partner_id: string;
2219
+
2220
+ /**
2221
+ * Trace ID for debugging and correlation across systems.
2222
+ */
2223
+ trace_id: string;
2224
+
2225
+ /**
2226
+ * Date-based webhook payload version. Determined by the `?version=` query
2227
+ * parameter in your webhook subscription URL. If no version parameter is
2228
+ * specified, defaults based on subscription creation date.
2229
+ */
2230
+ webhook_version: string;
2231
+ }
2232
+
2233
+ export namespace PollVoteAddedWebhookEvent {
2234
+ /**
2235
+ * Payload for poll.vote.added and poll.vote.removed (one option toggled).
2236
+ */
2237
+ export interface Data {
2238
+ /**
2239
+ * Chat info for poll webhook events.
2240
+ */
2241
+ chat: Data.Chat;
2242
+
2243
+ direction: 'inbound' | 'outbound';
2244
+
2245
+ message_id: string;
2246
+
2247
+ option_id: string;
2248
+
2249
+ /**
2250
+ * The voter — always present.
2251
+ */
2252
+ sender_handle: Shared.ChatHandle;
2253
+
2254
+ service: string;
2255
+ }
2256
+
2257
+ export namespace Data {
2258
+ /**
2259
+ * Chat info for poll webhook events.
2260
+ */
2261
+ export interface Chat {
2262
+ id: string;
2263
+
2264
+ is_group?: boolean | null;
2265
+
2266
+ owner_handle?: Shared.ChatHandle | null;
2267
+ }
2268
+ }
2269
+ }
2270
+
2271
+ /**
2272
+ * Complete webhook payload for poll.vote.removed events
2273
+ */
2274
+ export interface PollVoteRemovedWebhookEvent {
2275
+ /**
2276
+ * API version for the webhook payload format
2277
+ */
2278
+ api_version: string;
2279
+
2280
+ /**
2281
+ * When the event was created
2282
+ */
2283
+ created_at: string;
2284
+
2285
+ /**
2286
+ * Payload for poll.vote.added and poll.vote.removed (one option toggled).
2287
+ */
2288
+ data: PollVoteRemovedWebhookEvent.Data;
2289
+
2290
+ /**
2291
+ * Unique identifier for this event (for deduplication)
2292
+ */
2293
+ event_id: string;
2294
+
2295
+ /**
2296
+ * Valid webhook event types that can be subscribed to.
2297
+ *
2298
+ * **Note:** `message.edited` is only delivered to subscriptions using
2299
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
2300
+ * subscription will not produce any deliveries.
2301
+ */
2302
+ event_type: WebhookEventsAPI.WebhookEventType;
2303
+
2304
+ /**
2305
+ * Partner identifier. Present on all webhooks for cross-referencing.
2306
+ */
2307
+ partner_id: string;
2308
+
2309
+ /**
2310
+ * Trace ID for debugging and correlation across systems.
2311
+ */
2312
+ trace_id: string;
2313
+
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
+
2322
+ export namespace PollVoteRemovedWebhookEvent {
2323
+ /**
2324
+ * Payload for poll.vote.added and poll.vote.removed (one option toggled).
2325
+ */
2326
+ export interface Data {
2327
+ /**
2328
+ * Chat info for poll webhook events.
2329
+ */
2330
+ chat: Data.Chat;
2331
+
2332
+ direction: 'inbound' | 'outbound';
2333
+
2334
+ message_id: string;
2335
+
2336
+ option_id: string;
2337
+
2338
+ /**
2339
+ * The voter — always present.
2340
+ */
2341
+ sender_handle: Shared.ChatHandle;
2342
+
2343
+ service: string;
2344
+ }
2345
+
2346
+ export namespace Data {
2347
+ /**
2348
+ * Chat info for poll webhook events.
2349
+ */
2350
+ export interface Chat {
2351
+ id: string;
2352
+
2353
+ is_group?: boolean | null;
2354
+
2355
+ owner_handle?: Shared.ChatHandle | null;
2356
+ }
2357
+ }
2358
+ }
2359
+
2360
+ /**
2361
+ * Complete webhook payload for poll.reaction.added events
2362
+ */
2363
+ export interface PollReactionAddedWebhookEvent {
2364
+ /**
2365
+ * API version for the webhook payload format
2366
+ */
2367
+ api_version: string;
2368
+
2369
+ /**
2370
+ * When the event was created
2371
+ */
2372
+ created_at: string;
2373
+
2374
+ /**
2375
+ * Payload for poll.reaction.added — a reaction on a poll message. Same shape as
2376
+ * reaction.added; `message_id` is the poll-definition message's ID. Poll reactions
2377
+ * are stickers, which iMessage cannot remove, so there is no removal counterpart.
2378
+ */
2379
+ data: ReactionEventBase;
2380
+
2381
+ /**
2382
+ * Unique identifier for this event (for deduplication)
2383
+ */
2384
+ event_id: string;
2385
+
2386
+ /**
2387
+ * Valid webhook event types that can be subscribed to.
2388
+ *
2389
+ * **Note:** `message.edited` is only delivered to subscriptions using
2390
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
2391
+ * subscription will not produce any deliveries.
2392
+ */
2393
+ event_type: WebhookEventsAPI.WebhookEventType;
2394
+
2395
+ /**
2396
+ * Partner identifier. Present on all webhooks for cross-referencing.
2397
+ */
2398
+ partner_id: string;
2399
+
2400
+ /**
2401
+ * Trace ID for debugging and correlation across systems.
2402
+ */
2403
+ trace_id: string;
2404
+
2405
+ /**
2406
+ * Date-based webhook payload version. Determined by the `?version=` query
2407
+ * parameter in your webhook subscription URL. If no version parameter is
2408
+ * specified, defaults based on subscription creation date.
2409
+ */
2410
+ webhook_version: string;
2411
+ }
2412
+
1381
2413
  /**
1382
2414
  * Complete webhook payload for participant.added events
1383
2415
  */
@@ -1937,8 +2969,8 @@ export namespace ChatGroupNameUpdateFailedWebhookEvent {
1937
2969
 
1938
2970
  /**
1939
2971
  * Error codes in webhook failure events. The possible set varies by event:
1940
- * message.failed can carry 3007, 4001, 4002, 4005, 4006, 4007, or 4008; the group
1941
- * update failure events (chat.group_name_update_failed,
2972
+ * message.failed and poll.failed can carry 3007, 4001, 4002, 4005, 4006, 4007, or
2973
+ * 4008; the group update failure events (chat.group_name_update_failed,
1942
2974
  * chat.group_icon_update_failed) carry 3007 or 4001.
1943
2975
  */
1944
2976
  error_code: number;
@@ -2017,8 +3049,8 @@ export namespace ChatGroupIconUpdateFailedWebhookEvent {
2017
3049
 
2018
3050
  /**
2019
3051
  * Error codes in webhook failure events. The possible set varies by event:
2020
- * message.failed can carry 3007, 4001, 4002, 4005, 4006, 4007, or 4008; the group
2021
- * update failure events (chat.group_name_update_failed,
3052
+ * message.failed and poll.failed can carry 3007, 4001, 4002, 4005, 4006, 4007, or
3053
+ * 4008; the group update failure events (chat.group_name_update_failed,
2022
3054
  * chat.group_icon_update_failed) carry 3007 or 4001.
2023
3055
  */
2024
3056
  error_code: number;
@@ -2156,6 +3188,132 @@ export namespace ChatTypingIndicatorStoppedWebhookEvent {
2156
3188
  }
2157
3189
  }
2158
3190
 
3191
+ /**
3192
+ * Complete webhook payload for chat.background_updated events
3193
+ */
3194
+ export interface ChatBackgroundUpdatedWebhookEvent {
3195
+ /**
3196
+ * API version for the webhook payload format
3197
+ */
3198
+ api_version: string;
3199
+
3200
+ /**
3201
+ * When the event was created
3202
+ */
3203
+ created_at: string;
3204
+
3205
+ /**
3206
+ * Payload for chat.background_updated webhook events.
3207
+ */
3208
+ data: ChatBackgroundUpdatedWebhookEvent.Data;
3209
+
3210
+ /**
3211
+ * Unique identifier for this event (for deduplication)
3212
+ */
3213
+ event_id: string;
3214
+
3215
+ /**
3216
+ * Valid webhook event types that can be subscribed to.
3217
+ *
3218
+ * **Note:** `message.edited` is only delivered to subscriptions using
3219
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
3220
+ * subscription will not produce any deliveries.
3221
+ */
3222
+ event_type: WebhookEventsAPI.WebhookEventType;
3223
+
3224
+ /**
3225
+ * Partner identifier. Present on all webhooks for cross-referencing.
3226
+ */
3227
+ partner_id: string;
3228
+
3229
+ /**
3230
+ * Trace ID for debugging and correlation across systems.
3231
+ */
3232
+ trace_id: string;
3233
+
3234
+ /**
3235
+ * Date-based webhook payload version. Determined by the `?version=` query
3236
+ * parameter in your webhook subscription URL. If no version parameter is
3237
+ * specified, defaults based on subscription creation date.
3238
+ */
3239
+ webhook_version: string;
3240
+ }
3241
+
3242
+ export namespace ChatBackgroundUpdatedWebhookEvent {
3243
+ /**
3244
+ * Payload for chat.background_updated webhook events.
3245
+ */
3246
+ export interface Data {
3247
+ /**
3248
+ * Chat information
3249
+ */
3250
+ chat: Data.Chat;
3251
+
3252
+ /**
3253
+ * Who changed it. `is_me` is true when your own number set it.
3254
+ */
3255
+ actor_handle?: Shared.ChatHandle | null;
3256
+
3257
+ /**
3258
+ * A chat transcript background. Fields are populated per `type`.
3259
+ */
3260
+ background?: Data.Background | null;
3261
+ }
3262
+
3263
+ export namespace Data {
3264
+ /**
3265
+ * Chat information
3266
+ */
3267
+ export interface Chat {
3268
+ /**
3269
+ * Chat identifier
3270
+ */
3271
+ id: string;
3272
+
3273
+ /**
3274
+ * Whether this is a group chat
3275
+ */
3276
+ is_group?: boolean | null;
3277
+
3278
+ /**
3279
+ * Your phone number's handle. Always has is_me=true.
3280
+ */
3281
+ owner_handle?: Shared.ChatHandle | null;
3282
+ }
3283
+
3284
+ /**
3285
+ * A chat transcript background. Fields are populated per `type`.
3286
+ */
3287
+ export interface Background {
3288
+ /**
3289
+ * The background family.
3290
+ */
3291
+ type: 'color' | 'dynamic' | 'photo';
3292
+
3293
+ /**
3294
+ * Photo: the image URL.
3295
+ */
3296
+ image_url?: string | null;
3297
+
3298
+ /**
3299
+ * Color: the two gradient stops as hex, top then bottom.
3300
+ */
3301
+ shades?: Array<string> | null;
3302
+
3303
+ /**
3304
+ * Dynamic: the animated style.
3305
+ */
3306
+ style?: 'sky' | 'water' | 'aurora' | 'glitter' | null;
3307
+
3308
+ /**
3309
+ * Color: `custom` (the stored two colors) or a named swatch. Dynamic: the variant
3310
+ * within the `style` (e.g. `sunrise`).
3311
+ */
3312
+ variant?: string | null;
3313
+ }
3314
+ }
3315
+ }
3316
+
2159
3317
  /**
2160
3318
  * Complete webhook payload for phone_number.status_updated events
2161
3319
  */
@@ -2296,6 +3454,15 @@ export type UnwrapWebhookEvent =
2296
3454
  | MessageEditedWebhookEvent
2297
3455
  | ReactionAddedWebhookEvent
2298
3456
  | ReactionRemovedWebhookEvent
3457
+ | PollReceivedWebhookEvent
3458
+ | PollSentWebhookEvent
3459
+ | PollDeliveredWebhookEvent
3460
+ | PollReadWebhookEvent
3461
+ | PollUpdatedWebhookEvent
3462
+ | PollFailedWebhookEvent
3463
+ | PollVoteAddedWebhookEvent
3464
+ | PollVoteRemovedWebhookEvent
3465
+ | PollReactionAddedWebhookEvent
2299
3466
  | ParticipantAddedWebhookEvent
2300
3467
  | ParticipantRemovedWebhookEvent
2301
3468
  | ChatCreatedWebhookEvent
@@ -2305,6 +3472,7 @@ export type UnwrapWebhookEvent =
2305
3472
  | ChatGroupIconUpdateFailedWebhookEvent
2306
3473
  | ChatTypingIndicatorStartedWebhookEvent
2307
3474
  | ChatTypingIndicatorStoppedWebhookEvent
3475
+ | ChatBackgroundUpdatedWebhookEvent
2308
3476
  | PhoneNumberStatusUpdatedWebhookEvent;
2309
3477
 
2310
3478
  export declare namespace Webhooks {
@@ -2323,6 +3491,15 @@ export declare namespace Webhooks {
2323
3491
  type MessageEditedWebhookEvent as MessageEditedWebhookEvent,
2324
3492
  type ReactionAddedWebhookEvent as ReactionAddedWebhookEvent,
2325
3493
  type ReactionRemovedWebhookEvent as ReactionRemovedWebhookEvent,
3494
+ type PollReceivedWebhookEvent as PollReceivedWebhookEvent,
3495
+ type PollSentWebhookEvent as PollSentWebhookEvent,
3496
+ type PollDeliveredWebhookEvent as PollDeliveredWebhookEvent,
3497
+ type PollReadWebhookEvent as PollReadWebhookEvent,
3498
+ type PollUpdatedWebhookEvent as PollUpdatedWebhookEvent,
3499
+ type PollFailedWebhookEvent as PollFailedWebhookEvent,
3500
+ type PollVoteAddedWebhookEvent as PollVoteAddedWebhookEvent,
3501
+ type PollVoteRemovedWebhookEvent as PollVoteRemovedWebhookEvent,
3502
+ type PollReactionAddedWebhookEvent as PollReactionAddedWebhookEvent,
2326
3503
  type ParticipantAddedWebhookEvent as ParticipantAddedWebhookEvent,
2327
3504
  type ParticipantRemovedWebhookEvent as ParticipantRemovedWebhookEvent,
2328
3505
  type ChatCreatedWebhookEvent as ChatCreatedWebhookEvent,
@@ -2332,6 +3509,7 @@ export declare namespace Webhooks {
2332
3509
  type ChatGroupIconUpdateFailedWebhookEvent as ChatGroupIconUpdateFailedWebhookEvent,
2333
3510
  type ChatTypingIndicatorStartedWebhookEvent as ChatTypingIndicatorStartedWebhookEvent,
2334
3511
  type ChatTypingIndicatorStoppedWebhookEvent as ChatTypingIndicatorStoppedWebhookEvent,
3512
+ type ChatBackgroundUpdatedWebhookEvent as ChatBackgroundUpdatedWebhookEvent,
2335
3513
  type PhoneNumberStatusUpdatedWebhookEvent as PhoneNumberStatusUpdatedWebhookEvent,
2336
3514
  type UnwrapWebhookEvent as UnwrapWebhookEvent,
2337
3515
  };