@myronsi/messenger-api 2.1.0-alpha.2 → 2.1.0-alpha.20.next.97

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.
@@ -202,6 +202,15 @@
202
202
  "invalid_client_version",
203
203
  "blocked_by_user",
204
204
  "approval_required",
205
+ "user_verification_required",
206
+ "session_too_new",
207
+ "calls_unavailable",
208
+ "calls_not_allowed",
209
+ "call_identity_required",
210
+ "call_full",
211
+ "call_ended",
212
+ "already_in_call",
213
+ "stale_epoch",
205
214
  "internal_error"
206
215
  ]
207
216
  },
@@ -484,7 +493,8 @@
484
493
  "required": [
485
494
  "id",
486
495
  "type",
487
- "created_at"
496
+ "created_at",
497
+ "location"
488
498
  ],
489
499
  "properties": {
490
500
  "id": {
@@ -496,6 +506,24 @@
496
506
  "created_at": {
497
507
  "type": "string",
498
508
  "format": "date-time"
509
+ },
510
+ "user_agent": {
511
+ "type": [
512
+ "string",
513
+ "null"
514
+ ],
515
+ "maxLength": 512
516
+ },
517
+ "location": {
518
+ "description": "Approximate location of the client when the event happened; `null` when unknown.",
519
+ "oneOf": [
520
+ {
521
+ "$ref": "#/$defs/Location"
522
+ },
523
+ {
524
+ "type": "null"
525
+ }
526
+ ]
499
527
  }
500
528
  }
501
529
  }
@@ -509,17 +537,14 @@
509
537
  },
510
538
  {
511
539
  "type": "object",
512
- "description": "Recovery parts of the temporary recovery flow (redesigned in release 1.1).",
540
+ "description": "The one-time recovery key shown after registration.",
513
541
  "properties": {
514
542
  "recovery_key": {
515
543
  "type": "string",
516
544
  "description": "Shown once; only a keyed hash is stored"
517
545
  },
518
- "device_part": {
519
- "type": "string"
520
- },
521
- "qr_part": {
522
- "type": "string"
546
+ "username": {
547
+ "$ref": "#/$defs/Username"
523
548
  }
524
549
  }
525
550
  }
@@ -551,52 +576,6 @@
551
576
  }
552
577
  ]
553
578
  },
554
- "RecoveryRequest": {
555
- "type": "object",
556
- "required": [
557
- "username"
558
- ],
559
- "properties": {
560
- "username": {
561
- "$ref": "#/$defs/Username"
562
- },
563
- "device_part": {
564
- "type": "string"
565
- },
566
- "qr_part": {
567
- "type": "string"
568
- }
569
- }
570
- },
571
- "RecoveryResponse": {
572
- "type": "object",
573
- "required": [
574
- "recovery_token"
575
- ],
576
- "properties": {
577
- "recovery_token": {
578
- "type": "string"
579
- }
580
- }
581
- },
582
- "ResetPasswordRequest": {
583
- "type": "object",
584
- "required": [
585
- "recovery_token",
586
- "new_password"
587
- ],
588
- "properties": {
589
- "recovery_token": {
590
- "type": "string"
591
- },
592
- "new_password": {
593
- "type": "string",
594
- "minLength": 8,
595
- "maxLength": 128,
596
- "writeOnly": true
597
- }
598
- }
599
- },
600
579
  "WebSocketTicket": {
601
580
  "type": "object",
602
581
  "required": [
@@ -712,7 +691,8 @@
712
691
  "id",
713
692
  "created_at",
714
693
  "last_used_at",
715
- "is_current"
694
+ "is_current",
695
+ "location"
716
696
  ],
717
697
  "properties": {
718
698
  "id": {
@@ -737,6 +717,50 @@
737
717
  },
738
718
  "is_current": {
739
719
  "type": "boolean"
720
+ },
721
+ "location": {
722
+ "description": "Approximate location of the device when it signed in or last refreshed its token; `null` when unknown.",
723
+ "oneOf": [
724
+ {
725
+ "$ref": "#/$defs/Location"
726
+ },
727
+ {
728
+ "type": "null"
729
+ }
730
+ ]
731
+ }
732
+ }
733
+ },
734
+ "Location": {
735
+ "type": "object",
736
+ "description": "Approximate location of a client address, looked up in an offline GeoIP database (IP geolocation by\nDB-IP, https://db-ip.com, CC BY 4.0). The address itself is never exposed. Each field is `null` when the\ndatabase does not know it; clients localise the country name from `country_code`.\n",
737
+ "required": [
738
+ "city",
739
+ "country_code",
740
+ "country"
741
+ ],
742
+ "properties": {
743
+ "city": {
744
+ "type": [
745
+ "string",
746
+ "null"
747
+ ],
748
+ "description": "City name in English"
749
+ },
750
+ "country_code": {
751
+ "type": [
752
+ "string",
753
+ "null"
754
+ ],
755
+ "pattern": "^[A-Z]{2}$",
756
+ "description": "ISO 3166-1 alpha-2 country code"
757
+ },
758
+ "country": {
759
+ "type": [
760
+ "string",
761
+ "null"
762
+ ],
763
+ "description": "Country name in English"
740
764
  }
741
765
  }
742
766
  },
@@ -785,8 +809,7 @@
785
809
  "DisableTwoFactorRequest": {
786
810
  "type": "object",
787
811
  "required": [
788
- "password",
789
- "code"
812
+ "password"
790
813
  ],
791
814
  "properties": {
792
815
  "password": {
@@ -803,7 +826,7 @@
803
826
  },
804
827
  "Visibility": {
805
828
  "type": "string",
806
- "description": "Who may see the item. `*_except` scopes use the exception lists.",
829
+ "description": "Who may see the item. The exception lists apply to every value; `*_except` behave like `everyone` and `nobody`.\n`contacts` are the users you share a group with, or a direct chat that you opened or read in.\n",
807
830
  "enum": [
808
831
  "everyone",
809
832
  "contacts",
@@ -840,7 +863,7 @@
840
863
  },
841
864
  "PrivacyExceptions": {
842
865
  "type": "object",
843
- "description": "User IDs per setting; `allow` applies to `nobody_except`, `deny` to `everyone_except`.",
866
+ "description": "User IDs per setting. An exception wins over the setting whatever its value; `allow` always lets the user in, `deny` always keeps them out.",
844
867
  "additionalProperties": {
845
868
  "type": "object",
846
869
  "required": [
@@ -873,6 +896,8 @@
873
896
  "direct_messages",
874
897
  "group_invites",
875
898
  "search_visibility",
899
+ "calls_enabled",
900
+ "typing_indicators_enabled",
876
901
  "exceptions"
877
902
  ],
878
903
  "properties": {
@@ -897,6 +922,14 @@
897
922
  "search_visibility": {
898
923
  "$ref": "#/$defs/SearchVisibility"
899
924
  },
925
+ "calls_enabled": {
926
+ "type": "boolean",
927
+ "description": "Whether others may ring this user. Calls are only possible from an existing direct chat or a shared group."
928
+ },
929
+ "typing_indicators_enabled": {
930
+ "type": "boolean",
931
+ "description": "Whether other members see that this user is typing or recording a voice message. The user still sees theirs."
932
+ },
900
933
  "exceptions": {
901
934
  "$ref": "#/$defs/PrivacyExceptions"
902
935
  }
@@ -926,6 +959,12 @@
926
959
  },
927
960
  "search_visibility": {
928
961
  "$ref": "#/$defs/SearchVisibility"
962
+ },
963
+ "calls_enabled": {
964
+ "type": "boolean"
965
+ },
966
+ "typing_indicators_enabled": {
967
+ "type": "boolean"
929
968
  }
930
969
  }
931
970
  },
@@ -979,7 +1018,7 @@
979
1018
  "string",
980
1019
  "null"
981
1020
  ],
982
- "description": "Path of the avatar, always same-origin (`/api/v2/users/{id}/avatar`)."
1021
+ "description": "Path of the avatar, always same-origin (`/api/v2/users/{id}/avatar?rev={revision}`)."
983
1022
  },
984
1023
  "bio": {
985
1024
  "type": [
@@ -1182,6 +1221,14 @@
1182
1221
  ],
1183
1222
  "readOnly": true
1184
1223
  },
1224
+ "display_url": {
1225
+ "type": [
1226
+ "string",
1227
+ "null"
1228
+ ],
1229
+ "readOnly": true,
1230
+ "description": "A JPEG of at most 1600 px to show in an image viewer instead of the original; `null` for small images and GIFs, which are shown as they are."
1231
+ },
1185
1232
  "duration_ms": {
1186
1233
  "type": [
1187
1234
  "integer",
@@ -1199,6 +1246,178 @@
1199
1246
  "minimum": 0,
1200
1247
  "maximum": 255
1201
1248
  }
1249
+ },
1250
+ "drawing": {
1251
+ "description": "What the sender drew on this image of this message. Clients show the image with the drawing on top\nand never without it. Absent when the image has no drawing. The same image can carry another drawing\nin another message.\n",
1252
+ "$ref": "#/$defs/Drawing"
1253
+ }
1254
+ }
1255
+ },
1256
+ "Drawing": {
1257
+ "type": "object",
1258
+ "description": "Strokes and text labels on an image. Coordinates, widths and sizes are fractions of the image as it is\nshown (0 is the left or top edge, 1 the right or bottom edge), so the drawing fits any display size.\nItems are drawn in order. The server rounds numbers to four decimals.\n",
1259
+ "required": [
1260
+ "version",
1261
+ "items"
1262
+ ],
1263
+ "additionalProperties": false,
1264
+ "properties": {
1265
+ "version": {
1266
+ "type": "integer",
1267
+ "minimum": 1,
1268
+ "maximum": 1
1269
+ },
1270
+ "items": {
1271
+ "type": "array",
1272
+ "minItems": 1,
1273
+ "maxItems": 200,
1274
+ "items": {
1275
+ "$ref": "#/$defs/DrawingItem"
1276
+ }
1277
+ }
1278
+ }
1279
+ },
1280
+ "DrawingItem": {
1281
+ "type": "object",
1282
+ "required": [
1283
+ "type",
1284
+ "color"
1285
+ ],
1286
+ "additionalProperties": false,
1287
+ "properties": {
1288
+ "type": {
1289
+ "type": "string",
1290
+ "enum": [
1291
+ "stroke",
1292
+ "text"
1293
+ ]
1294
+ },
1295
+ "color": {
1296
+ "type": "string",
1297
+ "pattern": "^#[0-9a-fA-F]{6}$"
1298
+ },
1299
+ "width": {
1300
+ "type": "number",
1301
+ "format": "double",
1302
+ "minimum": 0.001,
1303
+ "maximum": 0.2,
1304
+ "description": "Stroke only. Line width as a fraction of the image width."
1305
+ },
1306
+ "points": {
1307
+ "type": "array",
1308
+ "minItems": 2,
1309
+ "maxItems": 10000,
1310
+ "description": "Stroke only. Flat list of x, y pairs. A drawing has at most 10000 numbers in all its strokes.",
1311
+ "items": {
1312
+ "type": "number",
1313
+ "format": "double",
1314
+ "minimum": 0,
1315
+ "maximum": 1
1316
+ }
1317
+ },
1318
+ "x": {
1319
+ "type": "number",
1320
+ "format": "double",
1321
+ "minimum": 0,
1322
+ "maximum": 1,
1323
+ "description": "Text only. Left edge of the label."
1324
+ },
1325
+ "y": {
1326
+ "type": "number",
1327
+ "format": "double",
1328
+ "minimum": 0,
1329
+ "maximum": 1,
1330
+ "description": "Text only. Top edge of the label."
1331
+ },
1332
+ "size": {
1333
+ "type": "number",
1334
+ "format": "double",
1335
+ "minimum": 0.01,
1336
+ "maximum": 0.5,
1337
+ "description": "Text only. Font height as a fraction of the image height."
1338
+ },
1339
+ "text": {
1340
+ "type": "string",
1341
+ "minLength": 1,
1342
+ "maxLength": 200,
1343
+ "description": "Text only."
1344
+ }
1345
+ },
1346
+ "if": {
1347
+ "properties": {
1348
+ "type": {
1349
+ "const": "stroke"
1350
+ }
1351
+ }
1352
+ },
1353
+ "then": {
1354
+ "required": [
1355
+ "width",
1356
+ "points"
1357
+ ],
1358
+ "properties": {
1359
+ "width": {
1360
+ "type": "number"
1361
+ },
1362
+ "points": {
1363
+ "type": "array"
1364
+ },
1365
+ "x": {
1366
+ "not": {}
1367
+ },
1368
+ "y": {
1369
+ "not": {}
1370
+ },
1371
+ "size": {
1372
+ "not": {}
1373
+ },
1374
+ "text": {
1375
+ "not": {}
1376
+ }
1377
+ }
1378
+ },
1379
+ "else": {
1380
+ "required": [
1381
+ "x",
1382
+ "y",
1383
+ "size",
1384
+ "text"
1385
+ ],
1386
+ "properties": {
1387
+ "x": {
1388
+ "type": "number"
1389
+ },
1390
+ "y": {
1391
+ "type": "number"
1392
+ },
1393
+ "size": {
1394
+ "type": "number"
1395
+ },
1396
+ "text": {
1397
+ "type": "string"
1398
+ },
1399
+ "width": {
1400
+ "not": {}
1401
+ },
1402
+ "points": {
1403
+ "not": {}
1404
+ }
1405
+ }
1406
+ }
1407
+ },
1408
+ "AttachmentDrawing": {
1409
+ "type": "object",
1410
+ "required": [
1411
+ "attachment_id",
1412
+ "drawing"
1413
+ ],
1414
+ "additionalProperties": false,
1415
+ "properties": {
1416
+ "attachment_id": {
1417
+ "$ref": "#/$defs/AttachmentRef"
1418
+ },
1419
+ "drawing": {
1420
+ "$ref": "#/$defs/Drawing"
1202
1421
  }
1203
1422
  }
1204
1423
  },
@@ -1206,7 +1425,8 @@
1206
1425
  "type": "string",
1207
1426
  "enum": [
1208
1427
  "image",
1209
- "audio"
1428
+ "audio",
1429
+ "visual"
1210
1430
  ]
1211
1431
  },
1212
1432
  "MessageType": {
@@ -1215,9 +1435,106 @@
1215
1435
  "text",
1216
1436
  "file",
1217
1437
  "voice",
1218
- "system"
1438
+ "system",
1439
+ "sticker"
1219
1440
  ]
1220
1441
  },
1442
+ "Sticker": {
1443
+ "type": "object",
1444
+ "description": "One sticker of a pack. `image` is a WebP or PNG of at most 512 x 512 px with transparency, animated when\n`is_animated` is true; any signed-in user can load it. Clients show it without a bubble.\n",
1445
+ "required": [
1446
+ "id",
1447
+ "pack_id",
1448
+ "emoji",
1449
+ "is_animated",
1450
+ "image"
1451
+ ],
1452
+ "properties": {
1453
+ "id": {
1454
+ "$ref": "#/$defs/Id"
1455
+ },
1456
+ "pack_id": {
1457
+ "$ref": "#/$defs/Id"
1458
+ },
1459
+ "emoji": {
1460
+ "type": "string",
1461
+ "minLength": 1,
1462
+ "maxLength": 32,
1463
+ "description": "The emoji the sticker stands for, for previews, notifications and search."
1464
+ },
1465
+ "is_animated": {
1466
+ "type": "boolean"
1467
+ },
1468
+ "image": {
1469
+ "$ref": "#/$defs/Attachment"
1470
+ }
1471
+ }
1472
+ },
1473
+ "StickerPack": {
1474
+ "type": "object",
1475
+ "required": [
1476
+ "id",
1477
+ "title",
1478
+ "is_official",
1479
+ "is_installed",
1480
+ "stickers"
1481
+ ],
1482
+ "properties": {
1483
+ "id": {
1484
+ "$ref": "#/$defs/Id"
1485
+ },
1486
+ "title": {
1487
+ "type": "string",
1488
+ "minLength": 1,
1489
+ "maxLength": 64
1490
+ },
1491
+ "is_official": {
1492
+ "type": "boolean",
1493
+ "description": "A built-in pack of the messenger, not made by a user."
1494
+ },
1495
+ "is_installed": {
1496
+ "type": "boolean",
1497
+ "description": "The pack is in the user's sticker panel."
1498
+ },
1499
+ "stickers": {
1500
+ "type": "array",
1501
+ "maxItems": 120,
1502
+ "items": {
1503
+ "$ref": "#/$defs/Sticker"
1504
+ }
1505
+ }
1506
+ }
1507
+ },
1508
+ "StickerPackList": {
1509
+ "type": "object",
1510
+ "required": [
1511
+ "items"
1512
+ ],
1513
+ "properties": {
1514
+ "items": {
1515
+ "type": "array",
1516
+ "maxItems": 200,
1517
+ "items": {
1518
+ "$ref": "#/$defs/StickerPack"
1519
+ }
1520
+ }
1521
+ }
1522
+ },
1523
+ "StickerList": {
1524
+ "type": "object",
1525
+ "required": [
1526
+ "items"
1527
+ ],
1528
+ "properties": {
1529
+ "items": {
1530
+ "type": "array",
1531
+ "maxItems": 20,
1532
+ "items": {
1533
+ "$ref": "#/$defs/Sticker"
1534
+ }
1535
+ }
1536
+ }
1537
+ },
1221
1538
  "Reaction": {
1222
1539
  "type": "object",
1223
1540
  "required": [
@@ -1276,16 +1593,67 @@
1276
1593
  }
1277
1594
  }
1278
1595
  },
1279
- "Message": {
1596
+ "ReplyPreview": {
1280
1597
  "type": "object",
1598
+ "description": "What a reply shows of the message it answers, so a client can draw the quote without loading that\nmessage. Set on messages of history pages and `message` events when the recipient can see the answered\nmessage; absent when it is gone or hidden for them, and on chat-list previews and search results.\n",
1281
1599
  "required": [
1282
1600
  "id",
1283
- "chat_id",
1284
1601
  "type",
1285
1602
  "sender",
1286
1603
  "content",
1287
1604
  "attachment",
1288
- "reply_to",
1605
+ "is_deleted"
1606
+ ],
1607
+ "properties": {
1608
+ "id": {
1609
+ "$ref": "#/$defs/Id"
1610
+ },
1611
+ "type": {
1612
+ "$ref": "#/$defs/MessageType"
1613
+ },
1614
+ "sender": {
1615
+ "oneOf": [
1616
+ {
1617
+ "$ref": "#/$defs/User"
1618
+ },
1619
+ {
1620
+ "type": "null"
1621
+ }
1622
+ ]
1623
+ },
1624
+ "content": {
1625
+ "type": [
1626
+ "string",
1627
+ "null"
1628
+ ],
1629
+ "maxLength": 100,
1630
+ "description": "The first 100 characters of the text or caption; `null` when deleted or empty."
1631
+ },
1632
+ "attachment": {
1633
+ "oneOf": [
1634
+ {
1635
+ "$ref": "#/$defs/Attachment"
1636
+ },
1637
+ {
1638
+ "type": "null"
1639
+ }
1640
+ ]
1641
+ },
1642
+ "is_deleted": {
1643
+ "type": "boolean"
1644
+ }
1645
+ }
1646
+ },
1647
+ "Message": {
1648
+ "type": "object",
1649
+ "required": [
1650
+ "id",
1651
+ "chat_id",
1652
+ "type",
1653
+ "sender",
1654
+ "content",
1655
+ "attachment",
1656
+ "reply_to",
1289
1657
  "forwarded_from",
1290
1658
  "reactions",
1291
1659
  "read_by",
@@ -1320,7 +1688,7 @@
1320
1688
  "null"
1321
1689
  ],
1322
1690
  "maxLength": 4096,
1323
- "description": "Text, or the caption of a file; `null` when deleted."
1691
+ "description": "Text, the caption of a file, or the emoji of a sticker; `null` when deleted."
1324
1692
  },
1325
1693
  "attachment": {
1326
1694
  "oneOf": [
@@ -1342,6 +1710,9 @@
1342
1710
  }
1343
1711
  ]
1344
1712
  },
1713
+ "reply_preview": {
1714
+ "$ref": "#/$defs/ReplyPreview"
1715
+ },
1345
1716
  "forwarded_from": {
1346
1717
  "oneOf": [
1347
1718
  {
@@ -1352,6 +1723,19 @@
1352
1723
  }
1353
1724
  ]
1354
1725
  },
1726
+ "sticker": {
1727
+ "description": "The sticker of a `sticker` message; absent for other types and when deleted. `attachment` carries the\nsame image, so older clients show a sticker as a picture.\n",
1728
+ "$ref": "#/$defs/Sticker"
1729
+ },
1730
+ "attachments": {
1731
+ "type": "array",
1732
+ "description": "Ordered images and videos of an album. The first item is also returned as attachment for older clients.",
1733
+ "minItems": 2,
1734
+ "maxItems": 10,
1735
+ "items": {
1736
+ "$ref": "#/$defs/Attachment"
1737
+ }
1738
+ },
1355
1739
  "reactions": {
1356
1740
  "type": "array",
1357
1741
  "items": {
@@ -1380,11 +1764,136 @@
1380
1764
  "is_deleted": {
1381
1765
  "type": "boolean"
1382
1766
  },
1767
+ "system_event": {
1768
+ "$ref": "#/$defs/SystemEvent"
1769
+ },
1383
1770
  "client_temp_id": {
1384
1771
  "$ref": "#/$defs/ClientTempId"
1385
1772
  }
1386
1773
  }
1387
1774
  },
1775
+ "LinkPreview": {
1776
+ "type": "object",
1777
+ "required": [
1778
+ "url",
1779
+ "title",
1780
+ "description",
1781
+ "site_name",
1782
+ "image"
1783
+ ],
1784
+ "properties": {
1785
+ "url": {
1786
+ "type": "string",
1787
+ "description": "The page after redirects"
1788
+ },
1789
+ "title": {
1790
+ "type": [
1791
+ "string",
1792
+ "null"
1793
+ ],
1794
+ "maxLength": 300
1795
+ },
1796
+ "description": {
1797
+ "type": [
1798
+ "string",
1799
+ "null"
1800
+ ],
1801
+ "maxLength": 500
1802
+ },
1803
+ "site_name": {
1804
+ "type": [
1805
+ "string",
1806
+ "null"
1807
+ ],
1808
+ "maxLength": 100
1809
+ },
1810
+ "image": {
1811
+ "oneOf": [
1812
+ {
1813
+ "$ref": "#/$defs/LinkPreviewImage"
1814
+ },
1815
+ {
1816
+ "type": "null"
1817
+ }
1818
+ ]
1819
+ }
1820
+ }
1821
+ },
1822
+ "LinkPreviewImage": {
1823
+ "type": "object",
1824
+ "required": [
1825
+ "url",
1826
+ "width",
1827
+ "height"
1828
+ ],
1829
+ "properties": {
1830
+ "url": {
1831
+ "type": "string",
1832
+ "description": "`GET /link-preview/image` with the signed address of the page's image"
1833
+ },
1834
+ "width": {
1835
+ "type": [
1836
+ "integer",
1837
+ "null"
1838
+ ],
1839
+ "minimum": 1
1840
+ },
1841
+ "height": {
1842
+ "type": [
1843
+ "integer",
1844
+ "null"
1845
+ ],
1846
+ "minimum": 1
1847
+ }
1848
+ }
1849
+ },
1850
+ "SystemEventKind": {
1851
+ "type": "string",
1852
+ "enum": [
1853
+ "group_created",
1854
+ "member_added",
1855
+ "member_joined",
1856
+ "member_removed",
1857
+ "member_left",
1858
+ "call"
1859
+ ]
1860
+ },
1861
+ "SystemEvent": {
1862
+ "type": "object",
1863
+ "description": "What a `system` message records; set on system messages only, whose `content` is then `null`. The names\nare the display names at the time of the event. `target` fields are set for `member_added` and\n`member_removed`. `call` is set for `call` messages: one per call, posted when the call ends, `actor` is the\ninitiator.\n",
1864
+ "required": [
1865
+ "kind",
1866
+ "actor_id",
1867
+ "actor_name"
1868
+ ],
1869
+ "properties": {
1870
+ "kind": {
1871
+ "$ref": "#/$defs/SystemEventKind"
1872
+ },
1873
+ "actor_id": {
1874
+ "oneOf": [
1875
+ {
1876
+ "$ref": "#/$defs/Id"
1877
+ },
1878
+ {
1879
+ "type": "null"
1880
+ }
1881
+ ]
1882
+ },
1883
+ "actor_name": {
1884
+ "type": "string"
1885
+ },
1886
+ "target_id": {
1887
+ "$ref": "#/$defs/Id"
1888
+ },
1889
+ "target_name": {
1890
+ "type": "string"
1891
+ },
1892
+ "call": {
1893
+ "$ref": "#/$defs/CallSummary"
1894
+ }
1895
+ }
1896
+ },
1388
1897
  "MessagePage": {
1389
1898
  "type": "object",
1390
1899
  "required": [
@@ -1475,7 +1984,8 @@
1475
1984
  "enum": [
1476
1985
  "text",
1477
1986
  "file",
1478
- "voice"
1987
+ "voice",
1988
+ "sticker"
1479
1989
  ]
1480
1990
  },
1481
1991
  "content": {
@@ -1485,8 +1995,12 @@
1485
1995
  ],
1486
1996
  "maxLength": 4096
1487
1997
  },
1998
+ "sticker_id": {
1999
+ "description": "The sticker of a `sticker` message, from any pack that is not deleted. Sticker messages have no content,\nattachment or drawings; the server sets `content` to the sticker's emoji. Send stickers with this\noperation; the WebSocket `message` event does not take them.\n",
2000
+ "$ref": "#/$defs/Id"
2001
+ },
1488
2002
  "attachment_id": {
1489
- "description": "Required and not null for `file` and `voice`; never a URL.",
2003
+ "description": "Single upload ID for a file or voice message. Omit for albums.",
1490
2004
  "oneOf": [
1491
2005
  {
1492
2006
  "$ref": "#/$defs/AttachmentRef"
@@ -1496,6 +2010,16 @@
1496
2010
  }
1497
2011
  ]
1498
2012
  },
2013
+ "attachment_ids": {
2014
+ "type": "array",
2015
+ "description": "Ordered IDs of two to ten image or video uploads for one file message.",
2016
+ "minItems": 2,
2017
+ "maxItems": 10,
2018
+ "uniqueItems": true,
2019
+ "items": {
2020
+ "$ref": "#/$defs/AttachmentRef"
2021
+ }
2022
+ },
1499
2023
  "reply_to": {
1500
2024
  "oneOf": [
1501
2025
  {
@@ -1505,6 +2029,14 @@
1505
2029
  "type": "null"
1506
2030
  }
1507
2031
  ]
2032
+ },
2033
+ "drawings": {
2034
+ "type": "array",
2035
+ "description": "Drawings on images of a `file` message, at most one per image. Each `attachment_id` must be one of the\nmessage's attachments. An image with a drawing may also be an image of the message in `reply_to`\ninstead of the sender's own upload: that is how a member draws on an image someone sent.\n",
2036
+ "maxItems": 10,
2037
+ "items": {
2038
+ "$ref": "#/$defs/AttachmentDrawing"
2039
+ }
1508
2040
  }
1509
2041
  },
1510
2042
  "if": {
@@ -1518,27 +2050,95 @@
1518
2050
  }
1519
2051
  },
1520
2052
  "then": {
1521
- "required": [
1522
- "attachment_id"
1523
- ],
1524
2053
  "properties": {
1525
- "attachment_id": {
1526
- "$ref": "#/$defs/AttachmentRef"
2054
+ "sticker_id": {
2055
+ "not": {}
1527
2056
  }
1528
- }
2057
+ },
2058
+ "oneOf": [
2059
+ {
2060
+ "required": [
2061
+ "attachment_id"
2062
+ ],
2063
+ "properties": {
2064
+ "attachment_id": {
2065
+ "$ref": "#/$defs/AttachmentRef"
2066
+ },
2067
+ "attachment_ids": {
2068
+ "not": {}
2069
+ }
2070
+ }
2071
+ },
2072
+ {
2073
+ "required": [
2074
+ "attachment_ids"
2075
+ ],
2076
+ "properties": {
2077
+ "type": {
2078
+ "const": "file"
2079
+ },
2080
+ "attachment_id": {
2081
+ "not": {}
2082
+ },
2083
+ "attachment_ids": {
2084
+ "type": "array"
2085
+ }
2086
+ }
2087
+ }
2088
+ ]
1529
2089
  },
1530
2090
  "else": {
1531
- "required": [
1532
- "content"
1533
- ],
1534
- "properties": {
1535
- "content": {
1536
- "type": "string",
1537
- "minLength": 1,
1538
- "maxLength": 4096
1539
- },
1540
- "attachment_id": {
1541
- "not": {}
2091
+ "if": {
2092
+ "properties": {
2093
+ "type": {
2094
+ "const": "sticker"
2095
+ }
2096
+ }
2097
+ },
2098
+ "then": {
2099
+ "required": [
2100
+ "sticker_id"
2101
+ ],
2102
+ "properties": {
2103
+ "sticker_id": {
2104
+ "$ref": "#/$defs/Id"
2105
+ },
2106
+ "content": {
2107
+ "not": {}
2108
+ },
2109
+ "attachment_id": {
2110
+ "not": {}
2111
+ },
2112
+ "attachment_ids": {
2113
+ "not": {}
2114
+ },
2115
+ "drawings": {
2116
+ "not": {}
2117
+ }
2118
+ }
2119
+ },
2120
+ "else": {
2121
+ "required": [
2122
+ "content"
2123
+ ],
2124
+ "properties": {
2125
+ "content": {
2126
+ "type": "string",
2127
+ "minLength": 1,
2128
+ "maxLength": 4096
2129
+ },
2130
+ "attachment_id": {
2131
+ "not": {}
2132
+ },
2133
+ "attachment_ids": {
2134
+ "not": {}
2135
+ },
2136
+ "drawings": {
2137
+ "not": {}
2138
+ },
2139
+ "sticker_id": {
2140
+ "not": {}
2141
+ }
1542
2142
  }
1543
2143
  }
1544
2144
  }
@@ -1551,8 +2151,8 @@
1551
2151
  "properties": {
1552
2152
  "content": {
1553
2153
  "type": "string",
1554
- "minLength": 1,
1555
- "maxLength": 4096
2154
+ "maxLength": 4096,
2155
+ "description": "New text, or the new caption of a file. Empty removes a file's caption; a text message rejects it."
1556
2156
  }
1557
2157
  }
1558
2158
  },
@@ -1573,32 +2173,137 @@
1573
2173
  }
1574
2174
  }
1575
2175
  },
1576
- "MarkReadRequest": {
2176
+ "ForwardMessagesRequest": {
1577
2177
  "type": "object",
1578
2178
  "required": [
1579
- "message_id"
2179
+ "message_ids",
2180
+ "chat_ids"
1580
2181
  ],
1581
2182
  "properties": {
1582
- "message_id": {
1583
- "description": "Everything up to and including this message is read.",
1584
- "$ref": "#/$defs/Id"
2183
+ "message_ids": {
2184
+ "type": "array",
2185
+ "minItems": 1,
2186
+ "maxItems": 20,
2187
+ "uniqueItems": true,
2188
+ "items": {
2189
+ "$ref": "#/$defs/Id"
2190
+ }
2191
+ },
2192
+ "chat_ids": {
2193
+ "type": "array",
2194
+ "minItems": 1,
2195
+ "maxItems": 20,
2196
+ "uniqueItems": true,
2197
+ "items": {
2198
+ "$ref": "#/$defs/Id"
2199
+ }
1585
2200
  }
1586
2201
  }
1587
2202
  },
1588
- "ChatType": {
1589
- "type": "string",
1590
- "enum": [
1591
- "direct",
1592
- "group"
1593
- ]
1594
- },
1595
- "GroupRole": {
1596
- "type": "string",
1597
- "enum": [
1598
- "owner",
1599
- "admin",
1600
- "member"
1601
- ]
2203
+ "DeleteMessagesRequest": {
2204
+ "type": "object",
2205
+ "required": [
2206
+ "message_ids",
2207
+ "scope"
2208
+ ],
2209
+ "properties": {
2210
+ "message_ids": {
2211
+ "type": "array",
2212
+ "minItems": 1,
2213
+ "maxItems": 100,
2214
+ "uniqueItems": true,
2215
+ "items": {
2216
+ "$ref": "#/$defs/Id"
2217
+ }
2218
+ },
2219
+ "scope": {
2220
+ "type": "string",
2221
+ "enum": [
2222
+ "me",
2223
+ "everyone"
2224
+ ]
2225
+ }
2226
+ }
2227
+ },
2228
+ "MarkReadRequest": {
2229
+ "type": "object",
2230
+ "required": [
2231
+ "message_id"
2232
+ ],
2233
+ "properties": {
2234
+ "message_id": {
2235
+ "description": "Everything up to and including this message is read.",
2236
+ "$ref": "#/$defs/Id"
2237
+ }
2238
+ }
2239
+ },
2240
+ "ChatType": {
2241
+ "type": "string",
2242
+ "enum": [
2243
+ "direct",
2244
+ "group"
2245
+ ]
2246
+ },
2247
+ "GroupRole": {
2248
+ "type": "string",
2249
+ "description": "A moderator may delete other members' messages; owners and admins also manage the group.",
2250
+ "enum": [
2251
+ "owner",
2252
+ "admin",
2253
+ "moderator",
2254
+ "member"
2255
+ ]
2256
+ },
2257
+ "GroupRoleEvent": {
2258
+ "type": "object",
2259
+ "description": "A member got a new role; `owner` means the actor transferred ownership to them.",
2260
+ "required": [
2261
+ "id",
2262
+ "actor",
2263
+ "target",
2264
+ "role",
2265
+ "created_at"
2266
+ ],
2267
+ "properties": {
2268
+ "id": {
2269
+ "$ref": "#/$defs/Id"
2270
+ },
2271
+ "actor": {
2272
+ "description": "`null` when the account is gone.",
2273
+ "oneOf": [
2274
+ {
2275
+ "$ref": "#/$defs/User"
2276
+ },
2277
+ {
2278
+ "type": "null"
2279
+ }
2280
+ ]
2281
+ },
2282
+ "target": {
2283
+ "$ref": "#/$defs/User"
2284
+ },
2285
+ "role": {
2286
+ "$ref": "#/$defs/GroupRole"
2287
+ },
2288
+ "created_at": {
2289
+ "$ref": "#/$defs/Timestamp"
2290
+ }
2291
+ }
2292
+ },
2293
+ "GroupRoleLog": {
2294
+ "type": "object",
2295
+ "required": [
2296
+ "items"
2297
+ ],
2298
+ "properties": {
2299
+ "items": {
2300
+ "type": "array",
2301
+ "description": "Newest first, at most 100",
2302
+ "items": {
2303
+ "$ref": "#/$defs/GroupRoleEvent"
2304
+ }
2305
+ }
2306
+ }
1602
2307
  },
1603
2308
  "Chat": {
1604
2309
  "type": "object",
@@ -1815,108 +2520,1121 @@
1815
2520
  "properties": {
1816
2521
  "name": {
1817
2522
  "type": "string",
1818
- "minLength": 1,
1819
- "maxLength": 64
2523
+ "minLength": 1,
2524
+ "maxLength": 64
2525
+ },
2526
+ "description": {
2527
+ "type": [
2528
+ "string",
2529
+ "null"
2530
+ ],
2531
+ "maxLength": 500
2532
+ }
2533
+ }
2534
+ },
2535
+ "AddParticipantRequest": {
2536
+ "type": "object",
2537
+ "required": [
2538
+ "user_id"
2539
+ ],
2540
+ "properties": {
2541
+ "user_id": {
2542
+ "$ref": "#/$defs/Id"
2543
+ }
2544
+ }
2545
+ },
2546
+ "UpdateRoleRequest": {
2547
+ "type": "object",
2548
+ "required": [
2549
+ "role"
2550
+ ],
2551
+ "properties": {
2552
+ "role": {
2553
+ "type": "string",
2554
+ "enum": [
2555
+ "admin",
2556
+ "moderator",
2557
+ "member"
2558
+ ]
2559
+ }
2560
+ }
2561
+ },
2562
+ "TransferOwnerRequest": {
2563
+ "type": "object",
2564
+ "required": [
2565
+ "user_id"
2566
+ ],
2567
+ "properties": {
2568
+ "user_id": {
2569
+ "$ref": "#/$defs/Id"
2570
+ }
2571
+ }
2572
+ },
2573
+ "ApprovalRequestType": {
2574
+ "type": "string",
2575
+ "enum": [
2576
+ "direct_message",
2577
+ "group_invite"
2578
+ ]
2579
+ },
2580
+ "ApprovalRequestStatus": {
2581
+ "type": "string",
2582
+ "enum": [
2583
+ "pending",
2584
+ "approved",
2585
+ "rejected"
2586
+ ]
2587
+ },
2588
+ "ApprovalRequest": {
2589
+ "type": "object",
2590
+ "required": [
2591
+ "id",
2592
+ "type",
2593
+ "status",
2594
+ "requester",
2595
+ "created_at"
2596
+ ],
2597
+ "properties": {
2598
+ "id": {
2599
+ "$ref": "#/$defs/Id"
2600
+ },
2601
+ "type": {
2602
+ "$ref": "#/$defs/ApprovalRequestType"
2603
+ },
2604
+ "status": {
2605
+ "$ref": "#/$defs/ApprovalRequestStatus"
2606
+ },
2607
+ "requester": {
2608
+ "$ref": "#/$defs/User"
2609
+ },
2610
+ "group_name": {
2611
+ "type": [
2612
+ "string",
2613
+ "null"
2614
+ ],
2615
+ "description": "Only for `group_invite`"
2616
+ },
2617
+ "preview": {
2618
+ "type": [
2619
+ "string",
2620
+ "null"
2621
+ ],
2622
+ "description": "First message of a direct-message request"
2623
+ },
2624
+ "created_at": {
2625
+ "$ref": "#/$defs/Timestamp"
2626
+ }
2627
+ }
2628
+ },
2629
+ "DeviceRecoveryStart": {
2630
+ "type": "object",
2631
+ "required": [
2632
+ "username"
2633
+ ],
2634
+ "properties": {
2635
+ "username": {
2636
+ "$ref": "#/$defs/Username"
2637
+ }
2638
+ }
2639
+ },
2640
+ "DeviceRecoveryResult": {
2641
+ "type": "object",
2642
+ "required": [
2643
+ "request_id",
2644
+ "match_number",
2645
+ "expires_at"
2646
+ ],
2647
+ "properties": {
2648
+ "request_id": {
2649
+ "type": "string",
2650
+ "minLength": 32,
2651
+ "maxLength": 128,
2652
+ "pattern": "^[A-Za-z0-9_-]+$"
2653
+ },
2654
+ "match_number": {
2655
+ "type": "integer",
2656
+ "minimum": 10,
2657
+ "maximum": 99
2658
+ },
2659
+ "expires_at": {
2660
+ "type": "string",
2661
+ "format": "date-time"
2662
+ }
2663
+ }
2664
+ },
2665
+ "DeviceRecoveryStatus": {
2666
+ "type": "object",
2667
+ "required": [
2668
+ "status"
2669
+ ],
2670
+ "properties": {
2671
+ "status": {
2672
+ "type": "string",
2673
+ "enum": [
2674
+ "pending",
2675
+ "approved",
2676
+ "denied",
2677
+ "used",
2678
+ "expired"
2679
+ ]
2680
+ }
2681
+ }
2682
+ },
2683
+ "DeviceRecoveryApproval": {
2684
+ "type": "object",
2685
+ "required": [
2686
+ "match_number"
2687
+ ],
2688
+ "properties": {
2689
+ "match_number": {
2690
+ "type": "integer",
2691
+ "minimum": 10,
2692
+ "maximum": 99
2693
+ },
2694
+ "passkey": {
2695
+ "$ref": "#/$defs/PasskeyVerification"
2696
+ },
2697
+ "code": {
2698
+ "type": "string",
2699
+ "maxLength": 128
2700
+ },
2701
+ "password": {
2702
+ "type": "string",
2703
+ "maxLength": 1024,
2704
+ "deprecated": true,
2705
+ "description": "Ignored. Older clients still send it."
2706
+ }
2707
+ }
2708
+ },
2709
+ "DeviceRecoveryApprovalOptions": {
2710
+ "type": "object",
2711
+ "required": [
2712
+ "method"
2713
+ ],
2714
+ "properties": {
2715
+ "method": {
2716
+ "type": "string",
2717
+ "enum": [
2718
+ "passkey",
2719
+ "session"
2720
+ ]
2721
+ },
2722
+ "challenge_id": {
2723
+ "type": "string",
2724
+ "minLength": 32,
2725
+ "maxLength": 128,
2726
+ "description": "Present with `method: passkey`."
2727
+ },
2728
+ "public_key": {
2729
+ "type": "object",
2730
+ "additionalProperties": true,
2731
+ "description": "WebAuthn request options, present with `method: passkey`."
2732
+ },
2733
+ "approvable_from": {
2734
+ "type": "string",
2735
+ "format": "date-time",
2736
+ "description": "Present with `method: session` while the session is too new to approve."
2737
+ }
2738
+ }
2739
+ },
2740
+ "DeviceRecoveryComplete": {
2741
+ "type": "object",
2742
+ "required": [
2743
+ "new_password"
2744
+ ],
2745
+ "properties": {
2746
+ "new_password": {
2747
+ "type": "string",
2748
+ "minLength": 8,
2749
+ "maxLength": 128,
2750
+ "writeOnly": true
2751
+ }
2752
+ }
2753
+ },
2754
+ "QrLoginStatus": {
2755
+ "type": "string",
2756
+ "description": "`pending` until a signed-in device opens the request, `scanned` once it did, then `approved` or `denied`.\n`expired` when the request timed out or was used (only in poll answers).\n",
2757
+ "enum": [
2758
+ "pending",
2759
+ "scanned",
2760
+ "approved",
2761
+ "denied",
2762
+ "expired"
2763
+ ]
2764
+ },
2765
+ "QrLoginStart": {
2766
+ "type": "object",
2767
+ "required": [
2768
+ "request_id",
2769
+ "poll_token",
2770
+ "url",
2771
+ "expires_at"
2772
+ ],
2773
+ "properties": {
2774
+ "request_id": {
2775
+ "type": "string",
2776
+ "minLength": 32,
2777
+ "maxLength": 128,
2778
+ "pattern": "^[A-Za-z0-9_-]+$"
2779
+ },
2780
+ "poll_token": {
2781
+ "type": "string",
2782
+ "minLength": 32,
2783
+ "maxLength": 128,
2784
+ "pattern": "^[A-Za-z0-9_-]+$",
2785
+ "description": "Secret of the requesting device; only a keyed hash is stored."
2786
+ },
2787
+ "url": {
2788
+ "type": "string",
2789
+ "description": "`<RECOVERY_WEB_URL>/qr/<request_id>`, the content of the QR code."
2790
+ },
2791
+ "expires_at": {
2792
+ "$ref": "#/$defs/Timestamp"
2793
+ }
2794
+ }
2795
+ },
2796
+ "QrLoginRequest": {
2797
+ "type": "object",
2798
+ "required": [
2799
+ "request_id",
2800
+ "status",
2801
+ "device",
2802
+ "location",
2803
+ "created_at",
2804
+ "expires_at"
2805
+ ],
2806
+ "properties": {
2807
+ "request_id": {
2808
+ "type": "string"
2809
+ },
2810
+ "status": {
2811
+ "$ref": "#/$defs/QrLoginStatus"
2812
+ },
2813
+ "device": {
2814
+ "type": [
2815
+ "string",
2816
+ "null"
2817
+ ],
2818
+ "maxLength": 512,
2819
+ "description": "User agent of the device that asks to sign in; `null` when it sent none."
2820
+ },
2821
+ "location": {
2822
+ "description": "Approximate location of the device that asks to sign in; `null` when unknown.",
2823
+ "oneOf": [
2824
+ {
2825
+ "$ref": "#/$defs/Location"
2826
+ },
2827
+ {
2828
+ "type": "null"
2829
+ }
2830
+ ]
2831
+ },
2832
+ "created_at": {
2833
+ "$ref": "#/$defs/Timestamp"
2834
+ },
2835
+ "expires_at": {
2836
+ "$ref": "#/$defs/Timestamp"
2837
+ }
2838
+ }
2839
+ },
2840
+ "QrLoginPollRequest": {
2841
+ "type": "object",
2842
+ "required": [
2843
+ "poll_token"
2844
+ ],
2845
+ "properties": {
2846
+ "poll_token": {
2847
+ "type": "string",
2848
+ "maxLength": 128,
2849
+ "writeOnly": true
2850
+ }
2851
+ }
2852
+ },
2853
+ "QrLoginPollResult": {
2854
+ "oneOf": [
2855
+ {
2856
+ "type": "object",
2857
+ "required": [
2858
+ "status"
2859
+ ],
2860
+ "properties": {
2861
+ "status": {
2862
+ "type": "string",
2863
+ "enum": [
2864
+ "pending",
2865
+ "scanned",
2866
+ "denied",
2867
+ "expired"
2868
+ ]
2869
+ }
2870
+ }
2871
+ },
2872
+ {
2873
+ "allOf": [
2874
+ {
2875
+ "$ref": "#/$defs/TokenResponse"
2876
+ },
2877
+ {
2878
+ "type": "object",
2879
+ "required": [
2880
+ "status"
2881
+ ],
2882
+ "properties": {
2883
+ "status": {
2884
+ "type": "string",
2885
+ "const": "approved"
2886
+ }
2887
+ }
2888
+ }
2889
+ ]
2890
+ }
2891
+ ]
2892
+ },
2893
+ "QrLoginApproval": {
2894
+ "type": "object",
2895
+ "properties": {
2896
+ "code": {
2897
+ "type": "string",
2898
+ "maxLength": 128,
2899
+ "description": "An authenticator code or an unused recovery code; required when two-factor is on."
2900
+ }
2901
+ }
2902
+ },
2903
+ "PasskeyOptions": {
2904
+ "type": "object",
2905
+ "required": [
2906
+ "challenge_id",
2907
+ "public_key"
2908
+ ],
2909
+ "properties": {
2910
+ "challenge_id": {
2911
+ "type": "string",
2912
+ "minLength": 32,
2913
+ "maxLength": 128
2914
+ },
2915
+ "public_key": {
2916
+ "type": "object",
2917
+ "additionalProperties": true
2918
+ }
2919
+ }
2920
+ },
2921
+ "PasskeyRegistration": {
2922
+ "type": "object",
2923
+ "required": [
2924
+ "password",
2925
+ "name"
2926
+ ],
2927
+ "properties": {
2928
+ "password": {
2929
+ "type": "string",
2930
+ "maxLength": 128,
2931
+ "writeOnly": true
2932
+ },
2933
+ "code": {
2934
+ "type": "string",
2935
+ "maxLength": 128
2936
+ },
2937
+ "name": {
2938
+ "type": "string",
2939
+ "minLength": 1,
2940
+ "maxLength": 64
2941
+ }
2942
+ }
2943
+ },
2944
+ "PasskeyVerification": {
2945
+ "type": "object",
2946
+ "required": [
2947
+ "challenge_id",
2948
+ "credential"
2949
+ ],
2950
+ "properties": {
2951
+ "challenge_id": {
2952
+ "type": "string",
2953
+ "minLength": 32,
2954
+ "maxLength": 128
2955
+ },
2956
+ "credential": {
2957
+ "type": "object",
2958
+ "additionalProperties": true
2959
+ }
2960
+ }
2961
+ },
2962
+ "PasskeyLoginOptions": {
2963
+ "type": "object",
2964
+ "required": [],
2965
+ "properties": {
2966
+ "username": {
2967
+ "$ref": "#/$defs/Username"
2968
+ }
2969
+ }
2970
+ },
2971
+ "PasskeyRename": {
2972
+ "type": "object",
2973
+ "required": [
2974
+ "name"
2975
+ ],
2976
+ "properties": {
2977
+ "name": {
2978
+ "type": "string",
2979
+ "minLength": 1,
2980
+ "maxLength": 64
2981
+ }
2982
+ }
2983
+ },
2984
+ "PasskeyRemoval": {
2985
+ "type": "object",
2986
+ "required": [],
2987
+ "properties": {
2988
+ "password": {
2989
+ "type": "string",
2990
+ "maxLength": 128,
2991
+ "writeOnly": true
2992
+ }
2993
+ }
2994
+ },
2995
+ "Passkey": {
2996
+ "type": "object",
2997
+ "required": [
2998
+ "id",
2999
+ "name",
3000
+ "created_at",
3001
+ "last_used_at"
3002
+ ],
3003
+ "properties": {
3004
+ "id": {
3005
+ "type": "string"
3006
+ },
3007
+ "name": {
3008
+ "type": "string",
3009
+ "minLength": 1,
3010
+ "maxLength": 64
3011
+ },
3012
+ "created_at": {
3013
+ "type": "string",
3014
+ "format": "date-time"
3015
+ },
3016
+ "last_used_at": {
3017
+ "type": [
3018
+ "string",
3019
+ "null"
3020
+ ],
3021
+ "format": "date-time"
3022
+ }
3023
+ }
3024
+ },
3025
+ "PasskeyPage": {
3026
+ "type": "object",
3027
+ "required": [
3028
+ "items"
3029
+ ],
3030
+ "properties": {
3031
+ "items": {
3032
+ "type": "array",
3033
+ "items": {
3034
+ "$ref": "#/$defs/Passkey"
3035
+ }
3036
+ }
3037
+ }
3038
+ },
3039
+ "RecoveryEmailStatus": {
3040
+ "type": "object",
3041
+ "required": [
3042
+ "address",
3043
+ "state",
3044
+ "enabled"
3045
+ ],
3046
+ "properties": {
3047
+ "address": {
3048
+ "type": "string"
3049
+ },
3050
+ "state": {
3051
+ "type": "string",
3052
+ "enum": [
3053
+ "not_added",
3054
+ "pending",
3055
+ "verified"
3056
+ ]
3057
+ },
3058
+ "enabled": {
3059
+ "type": "boolean"
3060
+ }
3061
+ }
3062
+ },
3063
+ "RecoveryOverview": {
3064
+ "type": "object",
3065
+ "required": [
3066
+ "recovery_key",
3067
+ "other_devices",
3068
+ "passkeys",
3069
+ "passkeys_enabled",
3070
+ "email"
3071
+ ],
3072
+ "properties": {
3073
+ "recovery_key": {
3074
+ "$ref": "#/$defs/RecoveryKeyStatus"
3075
+ },
3076
+ "other_devices": {
3077
+ "type": "integer",
3078
+ "minimum": 0
3079
+ },
3080
+ "passkeys": {
3081
+ "type": "integer",
3082
+ "minimum": 0
3083
+ },
3084
+ "passkeys_enabled": {
3085
+ "type": "boolean"
3086
+ },
3087
+ "email": {
3088
+ "$ref": "#/$defs/RecoveryEmailStatus"
3089
+ }
3090
+ }
3091
+ },
3092
+ "SetRecoveryEmail": {
3093
+ "type": "object",
3094
+ "required": [
3095
+ "email",
3096
+ "password"
3097
+ ],
3098
+ "properties": {
3099
+ "email": {
3100
+ "type": "string",
3101
+ "format": "email",
3102
+ "maxLength": 254
3103
+ },
3104
+ "password": {
3105
+ "type": "string",
3106
+ "minLength": 8,
3107
+ "maxLength": 128,
3108
+ "writeOnly": true
3109
+ },
3110
+ "code": {
3111
+ "type": "string",
3112
+ "maxLength": 128
3113
+ }
3114
+ }
3115
+ },
3116
+ "RemoveRecoveryEmail": {
3117
+ "type": "object",
3118
+ "required": [
3119
+ "password"
3120
+ ],
3121
+ "properties": {
3122
+ "password": {
3123
+ "type": "string",
3124
+ "minLength": 8,
3125
+ "maxLength": 128,
3126
+ "writeOnly": true
3127
+ },
3128
+ "code": {
3129
+ "type": "string",
3130
+ "maxLength": 128
3131
+ }
3132
+ }
3133
+ },
3134
+ "VerifyRecoveryEmail": {
3135
+ "type": "object",
3136
+ "required": [
3137
+ "token"
3138
+ ],
3139
+ "properties": {
3140
+ "token": {
3141
+ "type": "string",
3142
+ "minLength": 32,
3143
+ "maxLength": 128
3144
+ }
3145
+ }
3146
+ },
3147
+ "EmailResetRequest": {
3148
+ "type": "object",
3149
+ "required": [
3150
+ "username_or_email"
3151
+ ],
3152
+ "properties": {
3153
+ "username_or_email": {
3154
+ "type": "string",
3155
+ "maxLength": 254
3156
+ }
3157
+ }
3158
+ },
3159
+ "EmailResetConfirmation": {
3160
+ "type": "object",
3161
+ "required": [
3162
+ "token",
3163
+ "new_password"
3164
+ ],
3165
+ "properties": {
3166
+ "token": {
3167
+ "type": "string",
3168
+ "minLength": 32,
3169
+ "maxLength": 128
3170
+ },
3171
+ "new_password": {
3172
+ "type": "string",
3173
+ "minLength": 8,
3174
+ "maxLength": 128,
3175
+ "writeOnly": true
3176
+ },
3177
+ "code": {
3178
+ "type": "string",
3179
+ "maxLength": 128
3180
+ }
3181
+ }
3182
+ },
3183
+ "EmailResetAccepted": {
3184
+ "type": "object",
3185
+ "required": [
3186
+ "message"
3187
+ ],
3188
+ "properties": {
3189
+ "message": {
3190
+ "type": "string"
3191
+ }
3192
+ }
3193
+ },
3194
+ "CallConfig": {
3195
+ "type": "object",
3196
+ "required": [
3197
+ "enabled",
3198
+ "max_participants",
3199
+ "ring_timeout_seconds"
3200
+ ],
3201
+ "properties": {
3202
+ "enabled": {
3203
+ "type": "boolean"
3204
+ },
3205
+ "max_participants": {
3206
+ "type": "integer",
3207
+ "minimum": 2,
3208
+ "description": "Most sessions joined to one call at the same time."
3209
+ },
3210
+ "ring_timeout_seconds": {
3211
+ "type": "integer",
3212
+ "minimum": 1,
3213
+ "description": "How long an invitation rings before it counts as missed."
3214
+ }
3215
+ }
3216
+ },
3217
+ "CallIdentityRequest": {
3218
+ "type": "object",
3219
+ "required": [
3220
+ "public_key"
3221
+ ],
3222
+ "properties": {
3223
+ "public_key": {
3224
+ "$ref": "#/$defs/CallIdentityKey"
3225
+ }
3226
+ }
3227
+ },
3228
+ "CallIdentityKey": {
3229
+ "type": "string",
3230
+ "description": "P-256 public key as an uncompressed point (65 bytes, first byte `0x04`), base64url without padding.\n",
3231
+ "minLength": 87,
3232
+ "maxLength": 87,
3233
+ "pattern": "^[A-Za-z0-9_-]+$"
3234
+ },
3235
+ "CallState": {
3236
+ "type": "string",
3237
+ "description": "`ringing` until someone answers, `active` while people are in it, `ended` afterwards.",
3238
+ "enum": [
3239
+ "ringing",
3240
+ "active",
3241
+ "ended"
3242
+ ]
3243
+ },
3244
+ "CallEndReason": {
3245
+ "type": "string",
3246
+ "description": "Why the call ended: `completed` (people talked), `missed` (nobody answered in time), `declined` (the peer of a\ndirect call declined), `cancelled` (the caller hung up before an answer), `failed` (the media service lost\nthe call).\n",
3247
+ "enum": [
3248
+ "completed",
3249
+ "missed",
3250
+ "declined",
3251
+ "cancelled",
3252
+ "failed"
3253
+ ]
3254
+ },
3255
+ "CallParticipantState": {
3256
+ "type": "string",
3257
+ "description": "`left` and `declined` can become `joined` again in a group call.",
3258
+ "enum": [
3259
+ "ringing",
3260
+ "joined",
3261
+ "declined",
3262
+ "missed",
3263
+ "left"
3264
+ ]
3265
+ },
3266
+ "CallParticipant": {
3267
+ "type": "object",
3268
+ "required": [
3269
+ "user_id",
3270
+ "state",
3271
+ "session_id",
3272
+ "identity_key",
3273
+ "joined_at"
3274
+ ],
3275
+ "properties": {
3276
+ "user_id": {
3277
+ "$ref": "#/$defs/Id"
3278
+ },
3279
+ "state": {
3280
+ "$ref": "#/$defs/CallParticipantState"
3281
+ },
3282
+ "session_id": {
3283
+ "description": "The session that joined; `null` unless `state` is `joined`.",
3284
+ "oneOf": [
3285
+ {
3286
+ "type": "string",
3287
+ "format": "uuid"
3288
+ },
3289
+ {
3290
+ "type": "null"
3291
+ }
3292
+ ]
3293
+ },
3294
+ "identity_key": {
3295
+ "description": "Call identity of the joined session; `null` unless `state` is `joined`.",
3296
+ "oneOf": [
3297
+ {
3298
+ "$ref": "#/$defs/CallIdentityKey"
3299
+ },
3300
+ {
3301
+ "type": "null"
3302
+ }
3303
+ ]
3304
+ },
3305
+ "joined_at": {
3306
+ "description": "When the participant last joined; `null` if never.",
3307
+ "oneOf": [
3308
+ {
3309
+ "$ref": "#/$defs/Timestamp"
3310
+ },
3311
+ {
3312
+ "type": "null"
3313
+ }
3314
+ ]
3315
+ }
3316
+ }
3317
+ },
3318
+ "Call": {
3319
+ "type": "object",
3320
+ "required": [
3321
+ "id",
3322
+ "chat_id",
3323
+ "kind",
3324
+ "state",
3325
+ "end_reason",
3326
+ "initiator_id",
3327
+ "created_at",
3328
+ "started_at",
3329
+ "ended_at",
3330
+ "ring_expires_at",
3331
+ "epoch",
3332
+ "version",
3333
+ "max_participants",
3334
+ "participants"
3335
+ ],
3336
+ "properties": {
3337
+ "id": {
3338
+ "$ref": "#/$defs/Id"
3339
+ },
3340
+ "chat_id": {
3341
+ "$ref": "#/$defs/Id"
3342
+ },
3343
+ "kind": {
3344
+ "type": "string",
3345
+ "enum": [
3346
+ "direct",
3347
+ "group"
3348
+ ]
3349
+ },
3350
+ "state": {
3351
+ "$ref": "#/$defs/CallState"
3352
+ },
3353
+ "end_reason": {
3354
+ "oneOf": [
3355
+ {
3356
+ "$ref": "#/$defs/CallEndReason"
3357
+ },
3358
+ {
3359
+ "type": "null"
3360
+ }
3361
+ ]
3362
+ },
3363
+ "initiator_id": {
3364
+ "$ref": "#/$defs/Id"
3365
+ },
3366
+ "created_at": {
3367
+ "$ref": "#/$defs/Timestamp"
3368
+ },
3369
+ "started_at": {
3370
+ "description": "First answer; `null` while nobody answered.",
3371
+ "oneOf": [
3372
+ {
3373
+ "$ref": "#/$defs/Timestamp"
3374
+ },
3375
+ {
3376
+ "type": "null"
3377
+ }
3378
+ ]
3379
+ },
3380
+ "ended_at": {
3381
+ "oneOf": [
3382
+ {
3383
+ "$ref": "#/$defs/Timestamp"
3384
+ },
3385
+ {
3386
+ "type": "null"
3387
+ }
3388
+ ]
3389
+ },
3390
+ "ring_expires_at": {
3391
+ "description": "When ringing invitations of this call turn into `missed`.",
3392
+ "$ref": "#/$defs/Timestamp"
3393
+ },
3394
+ "epoch": {
3395
+ "type": "integer",
3396
+ "minimum": 0,
3397
+ "description": "Key epoch; increases whenever the set of joined sessions or their identity keys change."
3398
+ },
3399
+ "version": {
3400
+ "type": "integer",
3401
+ "minimum": 1,
3402
+ "description": "Increases with every change of the call; ignore events with a lower version than one already seen."
3403
+ },
3404
+ "max_participants": {
3405
+ "type": "integer",
3406
+ "minimum": 2
3407
+ },
3408
+ "participants": {
3409
+ "type": "array",
3410
+ "description": "Everyone invited or joined, the initiator first.",
3411
+ "items": {
3412
+ "$ref": "#/$defs/CallParticipant"
3413
+ }
3414
+ }
3415
+ }
3416
+ },
3417
+ "CallList": {
3418
+ "type": "object",
3419
+ "required": [
3420
+ "items"
3421
+ ],
3422
+ "properties": {
3423
+ "items": {
3424
+ "type": "array",
3425
+ "items": {
3426
+ "$ref": "#/$defs/Call"
3427
+ }
3428
+ }
3429
+ }
3430
+ },
3431
+ "StartCallRequest": {
3432
+ "type": "object",
3433
+ "required": [
3434
+ "client_request_id"
3435
+ ],
3436
+ "properties": {
3437
+ "client_request_id": {
3438
+ "type": "string",
3439
+ "format": "uuid",
3440
+ "description": "Idempotency key chosen by the client."
3441
+ }
3442
+ }
3443
+ },
3444
+ "JoinCallRequest": {
3445
+ "type": "object",
3446
+ "properties": {
3447
+ "takeover": {
3448
+ "type": "boolean",
3449
+ "default": false,
3450
+ "description": "Move the user's participation from another session to this one."
3451
+ }
3452
+ }
3453
+ },
3454
+ "CallGrant": {
3455
+ "type": "object",
3456
+ "required": [
3457
+ "url",
3458
+ "token",
3459
+ "identity",
3460
+ "expires_at"
3461
+ ],
3462
+ "properties": {
3463
+ "url": {
3464
+ "type": "string",
3465
+ "description": "WebSocket URL of the media server (`wss://`)."
3466
+ },
3467
+ "token": {
3468
+ "type": "string",
3469
+ "description": "Media access token for this call and session only; microphone audio only."
3470
+ },
3471
+ "identity": {
3472
+ "type": "string",
3473
+ "description": "The participant identity inside the media room (`<user_id>:<session_id>`)."
3474
+ },
3475
+ "expires_at": {
3476
+ "$ref": "#/$defs/Timestamp"
3477
+ }
3478
+ }
3479
+ },
3480
+ "CallJoin": {
3481
+ "type": "object",
3482
+ "required": [
3483
+ "call",
3484
+ "grant"
3485
+ ],
3486
+ "properties": {
3487
+ "call": {
3488
+ "$ref": "#/$defs/Call"
3489
+ },
3490
+ "grant": {
3491
+ "$ref": "#/$defs/CallGrant"
3492
+ }
3493
+ }
3494
+ },
3495
+ "CallKeyEnvelope": {
3496
+ "type": "object",
3497
+ "description": "An HPKE Auth-mode envelope carrying one sender key (see `docs/calls-e2ee.md`).",
3498
+ "required": [
3499
+ "epoch",
3500
+ "sender_user_id",
3501
+ "sender_session_id",
3502
+ "recipient_session_id",
3503
+ "enc",
3504
+ "ciphertext"
3505
+ ],
3506
+ "properties": {
3507
+ "epoch": {
3508
+ "type": "integer",
3509
+ "minimum": 0
3510
+ },
3511
+ "sender_user_id": {
3512
+ "$ref": "#/$defs/Id"
3513
+ },
3514
+ "sender_session_id": {
3515
+ "type": "string",
3516
+ "format": "uuid"
1820
3517
  },
1821
- "description": {
1822
- "type": [
1823
- "string",
1824
- "null"
1825
- ],
1826
- "maxLength": 500
3518
+ "recipient_session_id": {
3519
+ "type": "string",
3520
+ "format": "uuid"
3521
+ },
3522
+ "enc": {
3523
+ "type": "string",
3524
+ "description": "HPKE encapsulated key, base64url without padding.",
3525
+ "maxLength": 128,
3526
+ "pattern": "^[A-Za-z0-9_-]+$"
3527
+ },
3528
+ "ciphertext": {
3529
+ "type": "string",
3530
+ "description": "Sealed sender key, base64url without padding.",
3531
+ "maxLength": 256,
3532
+ "pattern": "^[A-Za-z0-9_-]+$"
1827
3533
  }
1828
3534
  }
1829
3535
  },
1830
- "AddParticipantRequest": {
3536
+ "CallKeyEnvelopeList": {
1831
3537
  "type": "object",
1832
3538
  "required": [
1833
- "user_id"
3539
+ "call_id",
3540
+ "epoch",
3541
+ "items"
1834
3542
  ],
1835
3543
  "properties": {
1836
- "user_id": {
3544
+ "call_id": {
1837
3545
  "$ref": "#/$defs/Id"
3546
+ },
3547
+ "epoch": {
3548
+ "type": "integer",
3549
+ "minimum": 0
3550
+ },
3551
+ "items": {
3552
+ "type": "array",
3553
+ "items": {
3554
+ "$ref": "#/$defs/CallKeyEnvelope"
3555
+ }
1838
3556
  }
1839
3557
  }
1840
3558
  },
1841
- "UpdateRoleRequest": {
3559
+ "SendCallKeysRequest": {
1842
3560
  "type": "object",
1843
3561
  "required": [
1844
- "role"
3562
+ "epoch",
3563
+ "envelopes"
1845
3564
  ],
1846
3565
  "properties": {
1847
- "role": {
1848
- "type": "string",
1849
- "enum": [
1850
- "admin",
1851
- "member"
1852
- ]
3566
+ "epoch": {
3567
+ "type": "integer",
3568
+ "minimum": 0
3569
+ },
3570
+ "envelopes": {
3571
+ "type": "array",
3572
+ "minItems": 1,
3573
+ "maxItems": 64,
3574
+ "items": {
3575
+ "$ref": "#/$defs/OutgoingCallKeyEnvelope"
3576
+ }
1853
3577
  }
1854
3578
  }
1855
3579
  },
1856
- "TransferOwnerRequest": {
3580
+ "OutgoingCallKeyEnvelope": {
1857
3581
  "type": "object",
1858
3582
  "required": [
1859
- "user_id"
3583
+ "recipient_session_id",
3584
+ "enc",
3585
+ "ciphertext"
1860
3586
  ],
1861
3587
  "properties": {
1862
- "user_id": {
1863
- "$ref": "#/$defs/Id"
3588
+ "recipient_session_id": {
3589
+ "type": "string",
3590
+ "format": "uuid"
3591
+ },
3592
+ "enc": {
3593
+ "type": "string",
3594
+ "maxLength": 128,
3595
+ "pattern": "^[A-Za-z0-9_-]+$"
3596
+ },
3597
+ "ciphertext": {
3598
+ "type": "string",
3599
+ "maxLength": 256,
3600
+ "pattern": "^[A-Za-z0-9_-]+$"
1864
3601
  }
1865
3602
  }
1866
3603
  },
1867
- "ApprovalRequestType": {
1868
- "type": "string",
1869
- "enum": [
1870
- "direct_message",
1871
- "group_invite"
1872
- ]
1873
- },
1874
- "ApprovalRequestStatus": {
1875
- "type": "string",
1876
- "enum": [
1877
- "pending",
1878
- "approved",
1879
- "rejected"
1880
- ]
1881
- },
1882
- "ApprovalRequest": {
3604
+ "CallSummary": {
1883
3605
  "type": "object",
3606
+ "description": "The call a `call` system message records.",
1884
3607
  "required": [
1885
- "id",
1886
- "type",
1887
- "status",
1888
- "requester",
1889
- "created_at"
3608
+ "call_id",
3609
+ "kind",
3610
+ "outcome",
3611
+ "duration_seconds"
1890
3612
  ],
1891
3613
  "properties": {
1892
- "id": {
3614
+ "call_id": {
1893
3615
  "$ref": "#/$defs/Id"
1894
3616
  },
1895
- "type": {
1896
- "$ref": "#/$defs/ApprovalRequestType"
1897
- },
1898
- "status": {
1899
- "$ref": "#/$defs/ApprovalRequestStatus"
1900
- },
1901
- "requester": {
1902
- "$ref": "#/$defs/User"
1903
- },
1904
- "group_name": {
1905
- "type": [
1906
- "string",
1907
- "null"
1908
- ],
1909
- "description": "Only for `group_invite`"
3617
+ "kind": {
3618
+ "type": "string",
3619
+ "enum": [
3620
+ "direct",
3621
+ "group"
3622
+ ]
1910
3623
  },
1911
- "preview": {
1912
- "type": [
1913
- "string",
1914
- "null"
1915
- ],
1916
- "description": "First message of a direct-message request"
3624
+ "outcome": {
3625
+ "$ref": "#/$defs/CallEndReason"
1917
3626
  },
1918
- "created_at": {
1919
- "$ref": "#/$defs/Timestamp"
3627
+ "duration_seconds": {
3628
+ "description": "From the first answer to the end; `null` if nobody answered.",
3629
+ "oneOf": [
3630
+ {
3631
+ "type": "integer",
3632
+ "minimum": 0
3633
+ },
3634
+ {
3635
+ "type": "null"
3636
+ }
3637
+ ]
1920
3638
  }
1921
3639
  }
1922
3640
  },
@@ -1965,7 +3683,7 @@
1965
3683
  },
1966
3684
  "ClientEditEvent": {
1967
3685
  "title": "ClientEditEvent",
1968
- "description": "Edit your own text message.",
3686
+ "description": "Edit your own text message or the caption of your file. An empty content removes a file's caption.",
1969
3687
  "type": "object",
1970
3688
  "properties": {
1971
3689
  "type": {
@@ -1985,7 +3703,6 @@
1985
3703
  },
1986
3704
  "content": {
1987
3705
  "type": "string",
1988
- "minLength": 1,
1989
3706
  "maxLength": 4096
1990
3707
  }
1991
3708
  },
@@ -2253,7 +3970,7 @@
2253
3970
  },
2254
3971
  "ClientTypingEvent": {
2255
3972
  "title": "ClientTypingEvent",
2256
- "description": "Tell the chat that you are (not) typing. Not acknowledged, so it carries no `client_temp_id`.",
3973
+ "description": "Tell the chat that you are (not) typing or recording a voice message. Not acknowledged, so it carries no `client_temp_id`. Send `is_typing: true` again every few seconds while it lasts and `false` when it ends; receivers hide it when it is not repeated. Dropped when your `typing_indicators_enabled` privacy setting is off.",
2257
3974
  "type": "object",
2258
3975
  "properties": {
2259
3976
  "type": {
@@ -2267,6 +3984,15 @@
2267
3984
  "properties": {
2268
3985
  "is_typing": {
2269
3986
  "type": "boolean"
3987
+ },
3988
+ "action": {
3989
+ "description": "What you are doing. Without it, `typing`.",
3990
+ "type": "string",
3991
+ "enum": [
3992
+ "typing",
3993
+ "recording_voice"
3994
+ ],
3995
+ "default": "typing"
2270
3996
  }
2271
3997
  },
2272
3998
  "required": [
@@ -2381,6 +4107,64 @@
2381
4107
  "data"
2382
4108
  ]
2383
4109
  },
4110
+ "ServerCallKeysEvent": {
4111
+ "title": "ServerCallKeysEvent",
4112
+ "description": "Sealed sender keys for this session (see docs/calls-e2ee.md). Sent only to the recipient session.",
4113
+ "type": "object",
4114
+ "properties": {
4115
+ "type": {
4116
+ "const": "call_keys"
4117
+ },
4118
+ "event_id": {
4119
+ "$ref": "#/$defs/Id"
4120
+ },
4121
+ "chat_id": {
4122
+ "$ref": "#/$defs/Id"
4123
+ },
4124
+ "data": {
4125
+ "$ref": "#/$defs/CallKeyEnvelopeList"
4126
+ }
4127
+ },
4128
+ "required": [
4129
+ "type",
4130
+ "event_id",
4131
+ "chat_id",
4132
+ "data"
4133
+ ]
4134
+ },
4135
+ "ServerCallUpdatedEvent": {
4136
+ "title": "ServerCallUpdatedEvent",
4137
+ "description": "A call of the chat started, rang, changed participants or epoch, or ended. Carries the whole call; keep the one with the highest `version`. Sent to every member of the chat.",
4138
+ "type": "object",
4139
+ "properties": {
4140
+ "type": {
4141
+ "const": "call_updated"
4142
+ },
4143
+ "event_id": {
4144
+ "$ref": "#/$defs/Id"
4145
+ },
4146
+ "chat_id": {
4147
+ "$ref": "#/$defs/Id"
4148
+ },
4149
+ "data": {
4150
+ "type": "object",
4151
+ "properties": {
4152
+ "call": {
4153
+ "$ref": "#/$defs/Call"
4154
+ }
4155
+ },
4156
+ "required": [
4157
+ "call"
4158
+ ]
4159
+ }
4160
+ },
4161
+ "required": [
4162
+ "type",
4163
+ "event_id",
4164
+ "chat_id",
4165
+ "data"
4166
+ ]
4167
+ },
2384
4168
  "ServerChatCreatedEvent": {
2385
4169
  "title": "ServerChatCreatedEvent",
2386
4170
  "description": "A chat was created with you.",
@@ -2897,6 +4681,136 @@
2897
4681
  "data"
2898
4682
  ]
2899
4683
  },
4684
+ "ServerRecoveryRequestEvent": {
4685
+ "title": "ServerRecoveryRequestEvent",
4686
+ "type": "object",
4687
+ "required": [
4688
+ "type",
4689
+ "event_id",
4690
+ "chat_id",
4691
+ "data"
4692
+ ],
4693
+ "additionalProperties": false,
4694
+ "properties": {
4695
+ "type": {
4696
+ "const": "recovery_request"
4697
+ },
4698
+ "event_id": {
4699
+ "type": "string",
4700
+ "pattern": "^[0-9]+$"
4701
+ },
4702
+ "chat_id": {
4703
+ "type": "null"
4704
+ },
4705
+ "data": {
4706
+ "type": "object",
4707
+ "required": [
4708
+ "request_id",
4709
+ "user_agent",
4710
+ "location",
4711
+ "choices",
4712
+ "expires_at"
4713
+ ],
4714
+ "properties": {
4715
+ "request_id": {
4716
+ "description": "Approval handle for POST /auth/recovery-requests/{requestId}/approve and /deny. It is not the requester's capability.",
4717
+ "type": "string",
4718
+ "minLength": 32,
4719
+ "maxLength": 128,
4720
+ "pattern": "^[A-Za-z0-9_-]+$"
4721
+ },
4722
+ "user_agent": {
4723
+ "type": "string"
4724
+ },
4725
+ "location": {
4726
+ "oneOf": [
4727
+ {
4728
+ "$ref": "#/$defs/Location"
4729
+ },
4730
+ {
4731
+ "type": "null"
4732
+ }
4733
+ ]
4734
+ },
4735
+ "choices": {
4736
+ "type": "array",
4737
+ "minItems": 3,
4738
+ "maxItems": 3,
4739
+ "uniqueItems": true,
4740
+ "items": {
4741
+ "type": "integer",
4742
+ "minimum": 10,
4743
+ "maximum": 99
4744
+ }
4745
+ },
4746
+ "expires_at": {
4747
+ "type": "string",
4748
+ "format": "date-time"
4749
+ }
4750
+ }
4751
+ }
4752
+ }
4753
+ },
4754
+ "ServerSecurityAlertEvent": {
4755
+ "title": "ServerSecurityAlertEvent",
4756
+ "type": "object",
4757
+ "required": [
4758
+ "type",
4759
+ "event_id",
4760
+ "chat_id",
4761
+ "data"
4762
+ ],
4763
+ "properties": {
4764
+ "type": {
4765
+ "const": "security_alert"
4766
+ },
4767
+ "event_id": {
4768
+ "$ref": "#/$defs/Id"
4769
+ },
4770
+ "chat_id": {
4771
+ "type": "null"
4772
+ },
4773
+ "data": {
4774
+ "type": "object",
4775
+ "required": [
4776
+ "type"
4777
+ ],
4778
+ "properties": {
4779
+ "type": {
4780
+ "type": "string",
4781
+ "enum": [
4782
+ "password_changed",
4783
+ "recovery_key_changed",
4784
+ "2fa_enabled",
4785
+ "2fa_disabled",
4786
+ "passkey_added",
4787
+ "passkey_removed",
4788
+ "recovery_email_changed",
4789
+ "recovery_email_removed",
4790
+ "passkey_counter_warning",
4791
+ "login",
4792
+ "login_2fa",
4793
+ "passkey_login",
4794
+ "qr_login_approved"
4795
+ ]
4796
+ },
4797
+ "user_agent": {
4798
+ "type": "string",
4799
+ "maxLength": 512
4800
+ },
4801
+ "created_at": {
4802
+ "type": "string",
4803
+ "format": "date-time"
4804
+ },
4805
+ "session_id": {
4806
+ "description": "The session that made the change, when a signed-in session made it. Clients skip alerts for their own session.",
4807
+ "type": "string",
4808
+ "format": "uuid"
4809
+ }
4810
+ }
4811
+ }
4812
+ }
4813
+ },
2900
4814
  "ServerSecurityNoticeEvent": {
2901
4815
  "title": "ServerSecurityNoticeEvent",
2902
4816
  "type": "object",
@@ -2931,7 +4845,7 @@
2931
4845
  },
2932
4846
  "ServerTypingEvent": {
2933
4847
  "title": "ServerTypingEvent",
2934
- "description": "A user started or stopped typing.",
4848
+ "description": "A user started or stopped typing or recording a voice message. Hide it after about 6 seconds without a repeat: the sender may disconnect before it sends `false`.",
2935
4849
  "type": "object",
2936
4850
  "properties": {
2937
4851
  "type": {
@@ -2951,11 +4865,20 @@
2951
4865
  },
2952
4866
  "is_typing": {
2953
4867
  "type": "boolean"
4868
+ },
4869
+ "action": {
4870
+ "description": "What the user is doing. New values may be added: show an unknown one like `typing`.",
4871
+ "type": "string",
4872
+ "enum": [
4873
+ "typing",
4874
+ "recording_voice"
4875
+ ]
2954
4876
  }
2955
4877
  },
2956
4878
  "required": [
2957
4879
  "user_id",
2958
- "is_typing"
4880
+ "is_typing",
4881
+ "action"
2959
4882
  ]
2960
4883
  }
2961
4884
  },
@@ -3006,6 +4929,12 @@
3006
4929
  {
3007
4930
  "$ref": "#/$defs/ServerApprovalRequestCreatedEvent"
3008
4931
  },
4932
+ {
4933
+ "$ref": "#/$defs/ServerCallKeysEvent"
4934
+ },
4935
+ {
4936
+ "$ref": "#/$defs/ServerCallUpdatedEvent"
4937
+ },
3009
4938
  {
3010
4939
  "$ref": "#/$defs/ServerChatCreatedEvent"
3011
4940
  },
@@ -3048,6 +4977,12 @@
3048
4977
  {
3049
4978
  "$ref": "#/$defs/ServerReadEvent"
3050
4979
  },
4980
+ {
4981
+ "$ref": "#/$defs/ServerRecoveryRequestEvent"
4982
+ },
4983
+ {
4984
+ "$ref": "#/$defs/ServerSecurityAlertEvent"
4985
+ },
3051
4986
  {
3052
4987
  "$ref": "#/$defs/ServerSecurityNoticeEvent"
3053
4988
  },