@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
@@ -872,8 +872,8 @@ export declare namespace MessageFailedWebhookEvent {
872
872
  interface Data {
873
873
  /**
874
874
  * Error codes in webhook failure events. The possible set varies by event:
875
- * message.failed can carry 3007, 4001, 4002, 4005, 4006, 4007, or 4008; the group
876
- * update failure events (chat.group_name_update_failed,
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
877
  * chat.group_icon_update_failed) carry 3007 or 4001.
878
878
  */
879
879
  code: number;
@@ -1174,6 +1174,820 @@ export interface ReactionRemovedWebhookEvent {
1174
1174
  */
1175
1175
  webhook_version: string;
1176
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
+ added_options: Array<Data.AddedOption>;
1650
+ /**
1651
+ * Chat info for poll webhook events.
1652
+ */
1653
+ chat: Data.Chat;
1654
+ direction: 'inbound' | 'outbound';
1655
+ message_id: string;
1656
+ /**
1657
+ * The line that added the option(s) — always present.
1658
+ */
1659
+ sender_handle: Shared.ChatHandle;
1660
+ service: string;
1661
+ }
1662
+ namespace Data {
1663
+ interface AddedOption {
1664
+ can_be_edited: boolean;
1665
+ /**
1666
+ * The participant who added this option (poll creator for the initial options;
1667
+ * whoever added later ones). Null when unknown.
1668
+ */
1669
+ creator_handle: Shared.ChatHandle;
1670
+ option_id: string;
1671
+ text: string;
1672
+ voters: Array<AddedOption.Voter>;
1673
+ }
1674
+ namespace AddedOption {
1675
+ interface Voter {
1676
+ handle: string;
1677
+ voted_at: string;
1678
+ }
1679
+ }
1680
+ /**
1681
+ * Chat info for poll webhook events.
1682
+ */
1683
+ interface Chat {
1684
+ id: string;
1685
+ is_group?: boolean | null;
1686
+ owner_handle?: Shared.ChatHandle | null;
1687
+ }
1688
+ }
1689
+ }
1690
+ /**
1691
+ * Complete webhook payload for poll.failed events
1692
+ */
1693
+ export interface PollFailedWebhookEvent {
1694
+ /**
1695
+ * API version for the webhook payload format
1696
+ */
1697
+ api_version: string;
1698
+ /**
1699
+ * When the event was created
1700
+ */
1701
+ created_at: string;
1702
+ /**
1703
+ * Payload for poll.failed — an outbound poll (or poll action) that failed to send.
1704
+ * Carries the poll snapshot at failure time plus the error and when it failed.
1705
+ */
1706
+ data: PollFailedWebhookEvent.Data;
1707
+ /**
1708
+ * Unique identifier for this event (for deduplication)
1709
+ */
1710
+ event_id: string;
1711
+ /**
1712
+ * Valid webhook event types that can be subscribed to.
1713
+ *
1714
+ * **Note:** `message.edited` is only delivered to subscriptions using
1715
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
1716
+ * subscription will not produce any deliveries.
1717
+ */
1718
+ event_type: WebhookEventsAPI.WebhookEventType;
1719
+ /**
1720
+ * Partner identifier. Present on all webhooks for cross-referencing.
1721
+ */
1722
+ partner_id: string;
1723
+ /**
1724
+ * Trace ID for debugging and correlation across systems.
1725
+ */
1726
+ trace_id: string;
1727
+ /**
1728
+ * Date-based webhook payload version. Determined by the `?version=` query
1729
+ * parameter in your webhook subscription URL. If no version parameter is
1730
+ * specified, defaults based on subscription creation date.
1731
+ */
1732
+ webhook_version: string;
1733
+ }
1734
+ export declare namespace PollFailedWebhookEvent {
1735
+ /**
1736
+ * Payload for poll.failed — an outbound poll (or poll action) that failed to send.
1737
+ * Carries the poll snapshot at failure time plus the error and when it failed.
1738
+ */
1739
+ interface Data {
1740
+ /**
1741
+ * Chat info for poll webhook events.
1742
+ */
1743
+ chat: Data.Chat;
1744
+ direction: 'inbound' | 'outbound';
1745
+ error: Data.Error;
1746
+ failed_at: string;
1747
+ message_id: string;
1748
+ poll: Data.Poll;
1749
+ service: string;
1750
+ /**
1751
+ * Null on failure (the send never landed).
1752
+ */
1753
+ sender_handle?: Shared.ChatHandle | null;
1754
+ }
1755
+ namespace Data {
1756
+ /**
1757
+ * Chat info for poll webhook events.
1758
+ */
1759
+ interface Chat {
1760
+ id: string;
1761
+ is_group?: boolean | null;
1762
+ owner_handle?: Shared.ChatHandle | null;
1763
+ }
1764
+ interface Error {
1765
+ /**
1766
+ * Error codes in webhook failure events. The possible set varies by event:
1767
+ * message.failed and poll.failed can carry 3007, 4001, 4002, 4005, 4006, 4007, or
1768
+ * 4008; the group update failure events (chat.group_name_update_failed,
1769
+ * chat.group_icon_update_failed) carry 3007 or 4001.
1770
+ */
1771
+ code: number;
1772
+ message: string;
1773
+ }
1774
+ interface Poll {
1775
+ options: Array<Poll.Option>;
1776
+ /**
1777
+ * Distinct participants across the whole poll.
1778
+ */
1779
+ total_voters: number;
1780
+ }
1781
+ namespace Poll {
1782
+ interface Option {
1783
+ can_be_edited: boolean;
1784
+ /**
1785
+ * The participant who added this option (poll creator for the initial options;
1786
+ * whoever added later ones). Null when unknown.
1787
+ */
1788
+ creator_handle: Shared.ChatHandle;
1789
+ option_id: string;
1790
+ text: string;
1791
+ voters: Array<Option.Voter>;
1792
+ }
1793
+ namespace Option {
1794
+ interface Voter {
1795
+ handle: string;
1796
+ voted_at: string;
1797
+ }
1798
+ }
1799
+ }
1800
+ }
1801
+ }
1802
+ /**
1803
+ * Complete webhook payload for poll.vote.added events
1804
+ */
1805
+ export interface PollVoteAddedWebhookEvent {
1806
+ /**
1807
+ * API version for the webhook payload format
1808
+ */
1809
+ api_version: string;
1810
+ /**
1811
+ * When the event was created
1812
+ */
1813
+ created_at: string;
1814
+ /**
1815
+ * Payload for poll.vote.added and poll.vote.removed (one option toggled).
1816
+ */
1817
+ data: PollVoteAddedWebhookEvent.Data;
1818
+ /**
1819
+ * Unique identifier for this event (for deduplication)
1820
+ */
1821
+ event_id: string;
1822
+ /**
1823
+ * Valid webhook event types that can be subscribed to.
1824
+ *
1825
+ * **Note:** `message.edited` is only delivered to subscriptions using
1826
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
1827
+ * subscription will not produce any deliveries.
1828
+ */
1829
+ event_type: WebhookEventsAPI.WebhookEventType;
1830
+ /**
1831
+ * Partner identifier. Present on all webhooks for cross-referencing.
1832
+ */
1833
+ partner_id: string;
1834
+ /**
1835
+ * Trace ID for debugging and correlation across systems.
1836
+ */
1837
+ trace_id: string;
1838
+ /**
1839
+ * Date-based webhook payload version. Determined by the `?version=` query
1840
+ * parameter in your webhook subscription URL. If no version parameter is
1841
+ * specified, defaults based on subscription creation date.
1842
+ */
1843
+ webhook_version: string;
1844
+ }
1845
+ export declare namespace PollVoteAddedWebhookEvent {
1846
+ /**
1847
+ * Payload for poll.vote.added and poll.vote.removed (one option toggled).
1848
+ */
1849
+ interface Data {
1850
+ /**
1851
+ * Chat info for poll webhook events.
1852
+ */
1853
+ chat: Data.Chat;
1854
+ direction: 'inbound' | 'outbound';
1855
+ message_id: string;
1856
+ option_id: string;
1857
+ /**
1858
+ * The voter — always present.
1859
+ */
1860
+ sender_handle: Shared.ChatHandle;
1861
+ service: string;
1862
+ }
1863
+ namespace Data {
1864
+ /**
1865
+ * Chat info for poll webhook events.
1866
+ */
1867
+ interface Chat {
1868
+ id: string;
1869
+ is_group?: boolean | null;
1870
+ owner_handle?: Shared.ChatHandle | null;
1871
+ }
1872
+ }
1873
+ }
1874
+ /**
1875
+ * Complete webhook payload for poll.vote.removed events
1876
+ */
1877
+ export interface PollVoteRemovedWebhookEvent {
1878
+ /**
1879
+ * API version for the webhook payload format
1880
+ */
1881
+ api_version: string;
1882
+ /**
1883
+ * When the event was created
1884
+ */
1885
+ created_at: string;
1886
+ /**
1887
+ * Payload for poll.vote.added and poll.vote.removed (one option toggled).
1888
+ */
1889
+ data: PollVoteRemovedWebhookEvent.Data;
1890
+ /**
1891
+ * Unique identifier for this event (for deduplication)
1892
+ */
1893
+ event_id: string;
1894
+ /**
1895
+ * Valid webhook event types that can be subscribed to.
1896
+ *
1897
+ * **Note:** `message.edited` is only delivered to subscriptions using
1898
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
1899
+ * subscription will not produce any deliveries.
1900
+ */
1901
+ event_type: WebhookEventsAPI.WebhookEventType;
1902
+ /**
1903
+ * Partner identifier. Present on all webhooks for cross-referencing.
1904
+ */
1905
+ partner_id: string;
1906
+ /**
1907
+ * Trace ID for debugging and correlation across systems.
1908
+ */
1909
+ trace_id: string;
1910
+ /**
1911
+ * Date-based webhook payload version. Determined by the `?version=` query
1912
+ * parameter in your webhook subscription URL. If no version parameter is
1913
+ * specified, defaults based on subscription creation date.
1914
+ */
1915
+ webhook_version: string;
1916
+ }
1917
+ export declare namespace PollVoteRemovedWebhookEvent {
1918
+ /**
1919
+ * Payload for poll.vote.added and poll.vote.removed (one option toggled).
1920
+ */
1921
+ interface Data {
1922
+ /**
1923
+ * Chat info for poll webhook events.
1924
+ */
1925
+ chat: Data.Chat;
1926
+ direction: 'inbound' | 'outbound';
1927
+ message_id: string;
1928
+ option_id: string;
1929
+ /**
1930
+ * The voter — always present.
1931
+ */
1932
+ sender_handle: Shared.ChatHandle;
1933
+ service: string;
1934
+ }
1935
+ namespace Data {
1936
+ /**
1937
+ * Chat info for poll webhook events.
1938
+ */
1939
+ interface Chat {
1940
+ id: string;
1941
+ is_group?: boolean | null;
1942
+ owner_handle?: Shared.ChatHandle | null;
1943
+ }
1944
+ }
1945
+ }
1946
+ /**
1947
+ * Complete webhook payload for poll.reaction.added events
1948
+ */
1949
+ export interface PollReactionAddedWebhookEvent {
1950
+ /**
1951
+ * API version for the webhook payload format
1952
+ */
1953
+ api_version: string;
1954
+ /**
1955
+ * When the event was created
1956
+ */
1957
+ created_at: string;
1958
+ /**
1959
+ * Payload for poll.reaction.added — a reaction on a poll message. Same shape as
1960
+ * reaction.added; `message_id` is the poll-definition message's ID. Poll reactions
1961
+ * are stickers, which iMessage cannot remove, so there is no removal counterpart.
1962
+ */
1963
+ data: ReactionEventBase;
1964
+ /**
1965
+ * Unique identifier for this event (for deduplication)
1966
+ */
1967
+ event_id: string;
1968
+ /**
1969
+ * Valid webhook event types that can be subscribed to.
1970
+ *
1971
+ * **Note:** `message.edited` is only delivered to subscriptions using
1972
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
1973
+ * subscription will not produce any deliveries.
1974
+ */
1975
+ event_type: WebhookEventsAPI.WebhookEventType;
1976
+ /**
1977
+ * Partner identifier. Present on all webhooks for cross-referencing.
1978
+ */
1979
+ partner_id: string;
1980
+ /**
1981
+ * Trace ID for debugging and correlation across systems.
1982
+ */
1983
+ trace_id: string;
1984
+ /**
1985
+ * Date-based webhook payload version. Determined by the `?version=` query
1986
+ * parameter in your webhook subscription URL. If no version parameter is
1987
+ * specified, defaults based on subscription creation date.
1988
+ */
1989
+ webhook_version: string;
1990
+ }
1177
1991
  /**
1178
1992
  * Complete webhook payload for participant.added events
1179
1993
  */
@@ -1655,8 +2469,8 @@ export declare namespace ChatGroupNameUpdateFailedWebhookEvent {
1655
2469
  chat_id: string;
1656
2470
  /**
1657
2471
  * Error codes in webhook failure events. The possible set varies by event:
1658
- * message.failed can carry 3007, 4001, 4002, 4005, 4006, 4007, or 4008; the group
1659
- * update failure events (chat.group_name_update_failed,
2472
+ * message.failed and poll.failed can carry 3007, 4001, 4002, 4005, 4006, 4007, or
2473
+ * 4008; the group update failure events (chat.group_name_update_failed,
1660
2474
  * chat.group_icon_update_failed) carry 3007 or 4001.
1661
2475
  */
1662
2476
  error_code: number;
@@ -1724,8 +2538,8 @@ export declare namespace ChatGroupIconUpdateFailedWebhookEvent {
1724
2538
  chat_id: string;
1725
2539
  /**
1726
2540
  * Error codes in webhook failure events. The possible set varies by event:
1727
- * message.failed can carry 3007, 4001, 4002, 4005, 4006, 4007, or 4008; the group
1728
- * update failure events (chat.group_name_update_failed,
2541
+ * message.failed and poll.failed can carry 3007, 4001, 4002, 4005, 4006, 4007, or
2542
+ * 4008; the group update failure events (chat.group_name_update_failed,
1729
2543
  * chat.group_icon_update_failed) carry 3007 or 4001.
1730
2544
  */
1731
2545
  error_code: number;
@@ -1843,6 +2657,113 @@ export declare namespace ChatTypingIndicatorStoppedWebhookEvent {
1843
2657
  chat_id: string;
1844
2658
  }
1845
2659
  }
2660
+ /**
2661
+ * Complete webhook payload for chat.background_updated events
2662
+ */
2663
+ export interface ChatBackgroundUpdatedWebhookEvent {
2664
+ /**
2665
+ * API version for the webhook payload format
2666
+ */
2667
+ api_version: string;
2668
+ /**
2669
+ * When the event was created
2670
+ */
2671
+ created_at: string;
2672
+ /**
2673
+ * Payload for chat.background_updated webhook events.
2674
+ */
2675
+ data: ChatBackgroundUpdatedWebhookEvent.Data;
2676
+ /**
2677
+ * Unique identifier for this event (for deduplication)
2678
+ */
2679
+ event_id: string;
2680
+ /**
2681
+ * Valid webhook event types that can be subscribed to.
2682
+ *
2683
+ * **Note:** `message.edited` is only delivered to subscriptions using
2684
+ * `webhook_version: "2026-02-03"`. Subscribing to this event on a v2025
2685
+ * subscription will not produce any deliveries.
2686
+ */
2687
+ event_type: WebhookEventsAPI.WebhookEventType;
2688
+ /**
2689
+ * Partner identifier. Present on all webhooks for cross-referencing.
2690
+ */
2691
+ partner_id: string;
2692
+ /**
2693
+ * Trace ID for debugging and correlation across systems.
2694
+ */
2695
+ trace_id: string;
2696
+ /**
2697
+ * Date-based webhook payload version. Determined by the `?version=` query
2698
+ * parameter in your webhook subscription URL. If no version parameter is
2699
+ * specified, defaults based on subscription creation date.
2700
+ */
2701
+ webhook_version: string;
2702
+ }
2703
+ export declare namespace ChatBackgroundUpdatedWebhookEvent {
2704
+ /**
2705
+ * Payload for chat.background_updated webhook events.
2706
+ */
2707
+ interface Data {
2708
+ /**
2709
+ * Chat information
2710
+ */
2711
+ chat: Data.Chat;
2712
+ /**
2713
+ * Who changed it. `is_me` is true when your own number set it.
2714
+ */
2715
+ actor_handle?: Shared.ChatHandle | null;
2716
+ /**
2717
+ * A chat transcript background. Fields are populated per `type`.
2718
+ */
2719
+ background?: Data.Background | null;
2720
+ }
2721
+ namespace Data {
2722
+ /**
2723
+ * Chat information
2724
+ */
2725
+ interface Chat {
2726
+ /**
2727
+ * Chat identifier
2728
+ */
2729
+ id: string;
2730
+ /**
2731
+ * Whether this is a group chat
2732
+ */
2733
+ is_group?: boolean | null;
2734
+ /**
2735
+ * Your phone number's handle. Always has is_me=true.
2736
+ */
2737
+ owner_handle?: Shared.ChatHandle | null;
2738
+ }
2739
+ /**
2740
+ * A chat transcript background. Fields are populated per `type`.
2741
+ */
2742
+ interface Background {
2743
+ /**
2744
+ * The background family.
2745
+ */
2746
+ type: 'color' | 'dynamic' | 'photo';
2747
+ /**
2748
+ * Photo: the image URL.
2749
+ */
2750
+ image_url?: string | null;
2751
+ /**
2752
+ * Color: the two gradient stops as hex, top then bottom.
2753
+ */
2754
+ shades?: Array<string> | null;
2755
+ /**
2756
+ * Dynamic: the animated style.
2757
+ */
2758
+ style?: 'sky' | 'water' | 'aurora' | 'glitter' | null;
2759
+ /**
2760
+ * Color: `custom` (the stored two colors) or a named swatch. Dynamic: the variant
2761
+ * within the `style` (e.g. `sunrise`).
2762
+ */
2763
+ variant?: string | null;
2764
+ }
2765
+ }
2766
+ }
1846
2767
  /**
1847
2768
  * Complete webhook payload for phone_number.status_updated events
1848
2769
  */
@@ -1916,8 +2837,8 @@ export declare namespace PhoneNumberStatusUpdatedWebhookEvent {
1916
2837
  /**
1917
2838
  * Complete webhook payload for message.sent events (2026-02-03 format)
1918
2839
  */
1919
- export type UnwrapWebhookEvent = MessageSentWebhookEvent | MessageReceivedWebhookEvent | MessageReadWebhookEvent | MessageDeliveredWebhookEvent | MessageFailedWebhookEvent | MessageEditedWebhookEvent | ReactionAddedWebhookEvent | ReactionRemovedWebhookEvent | ParticipantAddedWebhookEvent | ParticipantRemovedWebhookEvent | ChatCreatedWebhookEvent | ChatGroupNameUpdatedWebhookEvent | ChatGroupIconUpdatedWebhookEvent | ChatGroupNameUpdateFailedWebhookEvent | ChatGroupIconUpdateFailedWebhookEvent | ChatTypingIndicatorStartedWebhookEvent | ChatTypingIndicatorStoppedWebhookEvent | PhoneNumberStatusUpdatedWebhookEvent;
2840
+ 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;
1920
2841
  export declare namespace Webhooks {
1921
- 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 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 PhoneNumberStatusUpdatedWebhookEvent as PhoneNumberStatusUpdatedWebhookEvent, type UnwrapWebhookEvent as UnwrapWebhookEvent, };
2842
+ 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, };
1922
2843
  }
1923
2844
  //# sourceMappingURL=webhooks.d.mts.map