@myronsi/messenger-api 2.1.0-alpha.3.next.67 → 2.1.0-alpha.30

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.
@@ -17,6 +17,10 @@
17
17
  },
18
18
  "previews": {
19
19
  "type": "boolean"
20
+ },
21
+ "birthday_reminders": {
22
+ "type": "boolean",
23
+ "description": "A push at 09:00 (in `Me.time_zone`) when someone you have a direct chat with has a birthday. Always sent\nby the server; when a `PUT` leaves it out, it stays as it is. Defaults to `true`.\n"
20
24
  }
21
25
  }
22
26
  },
@@ -202,6 +206,16 @@
202
206
  "invalid_client_version",
203
207
  "blocked_by_user",
204
208
  "approval_required",
209
+ "user_verification_required",
210
+ "session_too_new",
211
+ "calls_unavailable",
212
+ "calls_not_allowed",
213
+ "call_identity_required",
214
+ "call_full",
215
+ "call_ended",
216
+ "already_in_call",
217
+ "stale_epoch",
218
+ "limit_reached",
205
219
  "internal_error"
206
220
  ]
207
221
  },
@@ -274,7 +288,8 @@
274
288
  "backend_version",
275
289
  "commit",
276
290
  "api_version",
277
- "min_client_api_version"
291
+ "min_client_api_version",
292
+ "connection_providers"
278
293
  ],
279
294
  "properties": {
280
295
  "backend_version": {
@@ -300,6 +315,142 @@
300
315
  "examples": [
301
316
  "2.0.0"
302
317
  ]
318
+ },
319
+ "connection_providers": {
320
+ "type": "array",
321
+ "description": "The connected-account providers this server offers.",
322
+ "items": {
323
+ "$ref": "#/$defs/ConnectionProvider"
324
+ }
325
+ }
326
+ }
327
+ },
328
+ "ConnectionProvider": {
329
+ "type": "string",
330
+ "description": "Providers that sign the user in: `github`, `spotify`, `steam`, `xbox`, `discord`, `twitch`, `youtube`,\n`reddit`, `roblox`, `tiktok`. Verified with a published code: `bluesky`, `mastodon`, `website`. Clients show a generic\nicon for a provider they do not know.\n",
331
+ "enum": [
332
+ "github",
333
+ "spotify",
334
+ "steam",
335
+ "xbox",
336
+ "discord",
337
+ "twitch",
338
+ "youtube",
339
+ "reddit",
340
+ "roblox",
341
+ "tiktok",
342
+ "bluesky",
343
+ "mastodon",
344
+ "website"
345
+ ]
346
+ },
347
+ "Connection": {
348
+ "type": "object",
349
+ "required": [
350
+ "id",
351
+ "provider",
352
+ "display_name",
353
+ "profile_url",
354
+ "verified_at"
355
+ ],
356
+ "properties": {
357
+ "id": {
358
+ "$ref": "#/$defs/Id"
359
+ },
360
+ "provider": {
361
+ "$ref": "#/$defs/ConnectionProvider"
362
+ },
363
+ "display_name": {
364
+ "type": "string",
365
+ "minLength": 1,
366
+ "maxLength": 100
367
+ },
368
+ "profile_url": {
369
+ "type": [
370
+ "string",
371
+ "null"
372
+ ],
373
+ "description": "The public https page of the account; `null` when the provider has none."
374
+ },
375
+ "verified_at": {
376
+ "$ref": "#/$defs/Timestamp"
377
+ }
378
+ }
379
+ },
380
+ "ConnectionList": {
381
+ "type": "object",
382
+ "required": [
383
+ "items"
384
+ ],
385
+ "properties": {
386
+ "items": {
387
+ "type": "array",
388
+ "maxItems": 15,
389
+ "items": {
390
+ "$ref": "#/$defs/Connection"
391
+ }
392
+ }
393
+ }
394
+ },
395
+ "ConnectionOrderRequest": {
396
+ "type": "object",
397
+ "required": [
398
+ "ids"
399
+ ],
400
+ "properties": {
401
+ "ids": {
402
+ "type": "array",
403
+ "maxItems": 15,
404
+ "uniqueItems": true,
405
+ "items": {
406
+ "$ref": "#/$defs/Id"
407
+ }
408
+ }
409
+ }
410
+ },
411
+ "ConnectionStart": {
412
+ "type": "object",
413
+ "required": [
414
+ "redirect_url"
415
+ ],
416
+ "properties": {
417
+ "redirect_url": {
418
+ "type": "string"
419
+ }
420
+ }
421
+ },
422
+ "ConnectionClaimRequest": {
423
+ "type": "object",
424
+ "required": [
425
+ "identifier"
426
+ ],
427
+ "properties": {
428
+ "identifier": {
429
+ "type": "string",
430
+ "minLength": 1,
431
+ "maxLength": 300,
432
+ "description": "A Bluesky handle (`alice.bsky.social`), a Mastodon account (`@alice@mastodon.social` or its URL), or a domain or URL."
433
+ }
434
+ }
435
+ },
436
+ "ConnectionChallenge": {
437
+ "type": "object",
438
+ "required": [
439
+ "identifier",
440
+ "code",
441
+ "expires_at"
442
+ ],
443
+ "properties": {
444
+ "identifier": {
445
+ "type": "string",
446
+ "description": "The account or domain as the server understood it."
447
+ },
448
+ "code": {
449
+ "type": "string",
450
+ "description": "The text to publish, such as `messenger-verify=ab12cd34ef56gh78`."
451
+ },
452
+ "expires_at": {
453
+ "$ref": "#/$defs/Timestamp"
303
454
  }
304
455
  }
305
456
  },
@@ -307,7 +458,6 @@
307
458
  "type": "object",
308
459
  "required": [
309
460
  "username",
310
- "display_name",
311
461
  "password"
312
462
  ],
313
463
  "properties": {
@@ -316,8 +466,8 @@
316
466
  },
317
467
  "display_name": {
318
468
  "type": "string",
319
- "minLength": 1,
320
- "maxLength": 64
469
+ "maxLength": 64,
470
+ "description": "Defaults to the username when it is missing, empty or only whitespace."
321
471
  },
322
472
  "password": {
323
473
  "type": "string",
@@ -484,7 +634,8 @@
484
634
  "required": [
485
635
  "id",
486
636
  "type",
487
- "created_at"
637
+ "created_at",
638
+ "location"
488
639
  ],
489
640
  "properties": {
490
641
  "id": {
@@ -496,6 +647,24 @@
496
647
  "created_at": {
497
648
  "type": "string",
498
649
  "format": "date-time"
650
+ },
651
+ "user_agent": {
652
+ "type": [
653
+ "string",
654
+ "null"
655
+ ],
656
+ "maxLength": 512
657
+ },
658
+ "location": {
659
+ "description": "Approximate location of the client when the event happened; `null` when unknown.",
660
+ "oneOf": [
661
+ {
662
+ "$ref": "#/$defs/Location"
663
+ },
664
+ {
665
+ "type": "null"
666
+ }
667
+ ]
499
668
  }
500
669
  }
501
670
  }
@@ -509,17 +678,14 @@
509
678
  },
510
679
  {
511
680
  "type": "object",
512
- "description": "Recovery parts of the temporary recovery flow (redesigned in release 1.1).",
681
+ "description": "The one-time recovery key shown after registration.",
513
682
  "properties": {
514
683
  "recovery_key": {
515
684
  "type": "string",
516
685
  "description": "Shown once; only a keyed hash is stored"
517
686
  },
518
- "device_part": {
519
- "type": "string"
520
- },
521
- "qr_part": {
522
- "type": "string"
687
+ "username": {
688
+ "$ref": "#/$defs/Username"
523
689
  }
524
690
  }
525
691
  }
@@ -551,52 +717,6 @@
551
717
  }
552
718
  ]
553
719
  },
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
720
  "WebSocketTicket": {
601
721
  "type": "object",
602
722
  "required": [
@@ -662,6 +782,28 @@
662
782
  "null"
663
783
  ],
664
784
  "maxLength": 500
785
+ },
786
+ "pronouns": {
787
+ "type": [
788
+ "string",
789
+ "null"
790
+ ],
791
+ "maxLength": 40,
792
+ "description": "Free text; `null` or an empty string removes it."
793
+ },
794
+ "birthday": {
795
+ "description": "`null` removes it. With a `year` the date must exist (no 29 February in other years); without one,\n29 February is allowed.\n",
796
+ "oneOf": [
797
+ {
798
+ "$ref": "#/$defs/Birthday"
799
+ },
800
+ {
801
+ "type": "null"
802
+ }
803
+ ]
804
+ },
805
+ "time_zone": {
806
+ "$ref": "#/$defs/TimeZone"
665
807
  }
666
808
  }
667
809
  },
@@ -712,7 +854,8 @@
712
854
  "id",
713
855
  "created_at",
714
856
  "last_used_at",
715
- "is_current"
857
+ "is_current",
858
+ "location"
716
859
  ],
717
860
  "properties": {
718
861
  "id": {
@@ -737,6 +880,50 @@
737
880
  },
738
881
  "is_current": {
739
882
  "type": "boolean"
883
+ },
884
+ "location": {
885
+ "description": "Approximate location of the device when it signed in or last refreshed its token; `null` when unknown.",
886
+ "oneOf": [
887
+ {
888
+ "$ref": "#/$defs/Location"
889
+ },
890
+ {
891
+ "type": "null"
892
+ }
893
+ ]
894
+ }
895
+ }
896
+ },
897
+ "Location": {
898
+ "type": "object",
899
+ "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",
900
+ "required": [
901
+ "city",
902
+ "country_code",
903
+ "country"
904
+ ],
905
+ "properties": {
906
+ "city": {
907
+ "type": [
908
+ "string",
909
+ "null"
910
+ ],
911
+ "description": "City name in English"
912
+ },
913
+ "country_code": {
914
+ "type": [
915
+ "string",
916
+ "null"
917
+ ],
918
+ "pattern": "^[A-Z]{2}$",
919
+ "description": "ISO 3166-1 alpha-2 country code"
920
+ },
921
+ "country": {
922
+ "type": [
923
+ "string",
924
+ "null"
925
+ ],
926
+ "description": "Country name in English"
740
927
  }
741
928
  }
742
929
  },
@@ -785,8 +972,7 @@
785
972
  "DisableTwoFactorRequest": {
786
973
  "type": "object",
787
974
  "required": [
788
- "password",
789
- "code"
975
+ "password"
790
976
  ],
791
977
  "properties": {
792
978
  "password": {
@@ -803,7 +989,7 @@
803
989
  },
804
990
  "Visibility": {
805
991
  "type": "string",
806
- "description": "Who may see the item. `*_except` scopes use the exception lists.",
992
+ "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
993
  "enum": [
808
994
  "everyone",
809
995
  "contacts",
@@ -840,7 +1026,7 @@
840
1026
  },
841
1027
  "PrivacyExceptions": {
842
1028
  "type": "object",
843
- "description": "User IDs per setting; `allow` applies to `nobody_except`, `deny` to `everyone_except`.",
1029
+ "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
1030
  "additionalProperties": {
845
1031
  "type": "object",
846
1032
  "required": [
@@ -869,10 +1055,14 @@
869
1055
  "avatar_visibility",
870
1056
  "profile_visibility",
871
1057
  "presence_visibility",
1058
+ "last_seen_visibility",
1059
+ "birthday_visibility",
872
1060
  "read_receipts_enabled",
873
1061
  "direct_messages",
874
1062
  "group_invites",
875
1063
  "search_visibility",
1064
+ "calls_enabled",
1065
+ "typing_indicators_enabled",
876
1066
  "exceptions"
877
1067
  ],
878
1068
  "properties": {
@@ -883,7 +1073,28 @@
883
1073
  "$ref": "#/$defs/Visibility"
884
1074
  },
885
1075
  "presence_visibility": {
886
- "$ref": "#/$defs/Visibility"
1076
+ "description": "Who sees that the user is online now (`User.is_online`, `presence` events).",
1077
+ "allOf": [
1078
+ {
1079
+ "$ref": "#/$defs/Visibility"
1080
+ }
1081
+ ]
1082
+ },
1083
+ "last_seen_visibility": {
1084
+ "description": "Who sees when the user was last online (`User.last_seen`, `presence` events).",
1085
+ "allOf": [
1086
+ {
1087
+ "$ref": "#/$defs/Visibility"
1088
+ }
1089
+ ]
1090
+ },
1091
+ "birthday_visibility": {
1092
+ "description": "Who sees the birthday (`User.birthday`) and gets a reminder on the day. Defaults to `contacts`.",
1093
+ "allOf": [
1094
+ {
1095
+ "$ref": "#/$defs/Visibility"
1096
+ }
1097
+ ]
887
1098
  },
888
1099
  "read_receipts_enabled": {
889
1100
  "type": "boolean"
@@ -897,6 +1108,14 @@
897
1108
  "search_visibility": {
898
1109
  "$ref": "#/$defs/SearchVisibility"
899
1110
  },
1111
+ "calls_enabled": {
1112
+ "type": "boolean",
1113
+ "description": "Whether others may ring this user. Calls are only possible from an existing direct chat or a shared group."
1114
+ },
1115
+ "typing_indicators_enabled": {
1116
+ "type": "boolean",
1117
+ "description": "Whether other members see that this user is typing or recording a voice message. The user still sees theirs."
1118
+ },
900
1119
  "exceptions": {
901
1120
  "$ref": "#/$defs/PrivacyExceptions"
902
1121
  }
@@ -915,6 +1134,12 @@
915
1134
  "presence_visibility": {
916
1135
  "$ref": "#/$defs/Visibility"
917
1136
  },
1137
+ "last_seen_visibility": {
1138
+ "$ref": "#/$defs/Visibility"
1139
+ },
1140
+ "birthday_visibility": {
1141
+ "$ref": "#/$defs/Visibility"
1142
+ },
918
1143
  "read_receipts_enabled": {
919
1144
  "type": "boolean"
920
1145
  },
@@ -926,6 +1151,12 @@
926
1151
  },
927
1152
  "search_visibility": {
928
1153
  "$ref": "#/$defs/SearchVisibility"
1154
+ },
1155
+ "calls_enabled": {
1156
+ "type": "boolean"
1157
+ },
1158
+ "typing_indicators_enabled": {
1159
+ "type": "boolean"
929
1160
  }
930
1161
  }
931
1162
  },
@@ -953,14 +1184,65 @@
953
1184
  "display_name",
954
1185
  "avatar_url",
955
1186
  "bio",
1187
+ "pronouns",
1188
+ "birthday",
1189
+ "music",
1190
+ "background",
956
1191
  "is_online",
957
1192
  "last_seen",
958
- "is_deleted"
1193
+ "is_deleted",
1194
+ "profile_version"
959
1195
  ],
960
1196
  "properties": {
961
1197
  "id": {
962
1198
  "$ref": "#/$defs/Id"
963
1199
  },
1200
+ "profile_version": {
1201
+ "type": "integer",
1202
+ "minimum": 0,
1203
+ "description": "Grows whenever the username, display name, bio, avatar, pronouns, birthday, profile music or profile\nbackground changes (not with presence). Clients keep a stored profile until a higher version arrives.\n"
1204
+ },
1205
+ "pronouns": {
1206
+ "type": [
1207
+ "string",
1208
+ "null"
1209
+ ],
1210
+ "maxLength": 40,
1211
+ "description": "Free text such as \"she/her\". Visible like the bio (`profile_visibility`)."
1212
+ },
1213
+ "birthday": {
1214
+ "description": "Visible by `birthday_visibility`; `null` when not set or hidden.",
1215
+ "oneOf": [
1216
+ {
1217
+ "$ref": "#/$defs/Birthday"
1218
+ },
1219
+ {
1220
+ "type": "null"
1221
+ }
1222
+ ]
1223
+ },
1224
+ "music": {
1225
+ "description": "A short song on the profile, visible like the bio. Clients never play it on their own.",
1226
+ "oneOf": [
1227
+ {
1228
+ "$ref": "#/$defs/ProfileMusic"
1229
+ },
1230
+ {
1231
+ "type": "null"
1232
+ }
1233
+ ]
1234
+ },
1235
+ "background": {
1236
+ "description": "The banner and page background of the profile, visible like the bio.",
1237
+ "oneOf": [
1238
+ {
1239
+ "$ref": "#/$defs/ProfileBackground"
1240
+ },
1241
+ {
1242
+ "type": "null"
1243
+ }
1244
+ ]
1245
+ },
964
1246
  "username": {
965
1247
  "$ref": "#/$defs/Username"
966
1248
  },
@@ -979,7 +1261,7 @@
979
1261
  "string",
980
1262
  "null"
981
1263
  ],
982
- "description": "Path of the avatar, always same-origin (`/api/v2/users/{id}/avatar`)."
1264
+ "description": "Path of the avatar, always same-origin (`/api/v2/users/{id}/avatar?rev={revision}`)."
983
1265
  },
984
1266
  "bio": {
985
1267
  "type": [
@@ -1013,7 +1295,8 @@
1013
1295
  {
1014
1296
  "type": "object",
1015
1297
  "required": [
1016
- "created_at"
1298
+ "created_at",
1299
+ "time_zone"
1017
1300
  ],
1018
1301
  "properties": {
1019
1302
  "created_at": {
@@ -1021,23 +1304,210 @@
1021
1304
  },
1022
1305
  "recovery_setup_required": {
1023
1306
  "type": "boolean"
1307
+ },
1308
+ "time_zone": {
1309
+ "allOf": [
1310
+ {
1311
+ "$ref": "#/$defs/TimeZone"
1312
+ }
1313
+ ],
1314
+ "description": "The user's time zone; birthday reminders arrive at 09:00 in it. `UTC` until a client sets it."
1024
1315
  }
1025
1316
  }
1026
1317
  }
1027
1318
  ]
1028
1319
  },
1029
- "UserPage": {
1320
+ "TimeZone": {
1321
+ "type": "string",
1322
+ "minLength": 1,
1323
+ "maxLength": 64,
1324
+ "description": "An IANA time zone name such as `Europe/Berlin`.",
1325
+ "examples": [
1326
+ "Europe/Berlin"
1327
+ ]
1328
+ },
1329
+ "Birthday": {
1030
1330
  "type": "object",
1031
1331
  "required": [
1032
- "items",
1033
- "next_cursor"
1332
+ "day",
1333
+ "month",
1334
+ "year"
1034
1335
  ],
1035
1336
  "properties": {
1036
- "items": {
1037
- "type": "array",
1038
- "items": {
1039
- "$ref": "#/$defs/User"
1040
- }
1337
+ "day": {
1338
+ "type": "integer",
1339
+ "minimum": 1,
1340
+ "maximum": 31
1341
+ },
1342
+ "month": {
1343
+ "type": "integer",
1344
+ "minimum": 1,
1345
+ "maximum": 12
1346
+ },
1347
+ "year": {
1348
+ "type": [
1349
+ "integer",
1350
+ "null"
1351
+ ],
1352
+ "minimum": 1900,
1353
+ "maximum": 2100,
1354
+ "description": "Optional; `null` when the user keeps the year to themselves."
1355
+ }
1356
+ }
1357
+ },
1358
+ "ProfileMusic": {
1359
+ "type": "object",
1360
+ "required": [
1361
+ "attachment",
1362
+ "title",
1363
+ "artist"
1364
+ ],
1365
+ "properties": {
1366
+ "attachment": {
1367
+ "allOf": [
1368
+ {
1369
+ "$ref": "#/$defs/Attachment"
1370
+ }
1371
+ ],
1372
+ "description": "The clip (at most 30 s). `thumbnail_url` is the cover when the file had one."
1373
+ },
1374
+ "title": {
1375
+ "type": [
1376
+ "string",
1377
+ "null"
1378
+ ],
1379
+ "maxLength": 100
1380
+ },
1381
+ "artist": {
1382
+ "type": [
1383
+ "string",
1384
+ "null"
1385
+ ],
1386
+ "maxLength": 100
1387
+ }
1388
+ }
1389
+ },
1390
+ "ProfileBackgroundKind": {
1391
+ "type": "string",
1392
+ "description": "`media` an uploaded image, GIF or short video (`attachment`), `preset` one of the clients' built-in\ngradients (`preset`), `color` one color or a gradient of two (`colors`).\n",
1393
+ "enum": [
1394
+ "media",
1395
+ "preset",
1396
+ "color"
1397
+ ]
1398
+ },
1399
+ "BackgroundPreset": {
1400
+ "type": "string",
1401
+ "pattern": "^[a-z0-9_-]{1,32}$",
1402
+ "description": "Name of a built-in gradient. Clients show their default background for a name they do not know."
1403
+ },
1404
+ "BackgroundColor": {
1405
+ "type": "string",
1406
+ "pattern": "^#[0-9a-f]{6}$",
1407
+ "examples": [
1408
+ "#3366ff"
1409
+ ]
1410
+ },
1411
+ "ProfileBackground": {
1412
+ "type": "object",
1413
+ "required": [
1414
+ "kind"
1415
+ ],
1416
+ "properties": {
1417
+ "kind": {
1418
+ "$ref": "#/$defs/ProfileBackgroundKind"
1419
+ },
1420
+ "attachment": {
1421
+ "allOf": [
1422
+ {
1423
+ "$ref": "#/$defs/Attachment"
1424
+ }
1425
+ ],
1426
+ "description": "Set for `media`. An image, an animated GIF or a muted video of at most 15 s; `thumbnail_url` is a still\nframe to show while it loads and when the viewer prefers reduced motion.\n"
1427
+ },
1428
+ "preset": {
1429
+ "$ref": "#/$defs/BackgroundPreset"
1430
+ },
1431
+ "colors": {
1432
+ "type": "array",
1433
+ "minItems": 1,
1434
+ "maxItems": 2,
1435
+ "items": {
1436
+ "$ref": "#/$defs/BackgroundColor"
1437
+ }
1438
+ }
1439
+ }
1440
+ },
1441
+ "SetBackgroundRequest": {
1442
+ "type": "object",
1443
+ "required": [
1444
+ "kind"
1445
+ ],
1446
+ "description": "`media` needs `attachment_id` (uploaded with purpose `profile_background`), `preset` needs `preset`, `color`\nneeds `colors`; other fields must be absent (`422` otherwise).\n",
1447
+ "properties": {
1448
+ "kind": {
1449
+ "$ref": "#/$defs/ProfileBackgroundKind"
1450
+ },
1451
+ "attachment_id": {
1452
+ "$ref": "#/$defs/AttachmentRef"
1453
+ },
1454
+ "preset": {
1455
+ "$ref": "#/$defs/BackgroundPreset"
1456
+ },
1457
+ "colors": {
1458
+ "type": "array",
1459
+ "minItems": 1,
1460
+ "maxItems": 2,
1461
+ "items": {
1462
+ "$ref": "#/$defs/BackgroundColor"
1463
+ }
1464
+ }
1465
+ }
1466
+ },
1467
+ "SetMusicRequest": {
1468
+ "type": "object",
1469
+ "required": [
1470
+ "attachment_id"
1471
+ ],
1472
+ "properties": {
1473
+ "attachment_id": {
1474
+ "allOf": [
1475
+ {
1476
+ "$ref": "#/$defs/AttachmentRef"
1477
+ }
1478
+ ],
1479
+ "description": "An upload of the caller with purpose `profile_music`."
1480
+ },
1481
+ "title": {
1482
+ "type": [
1483
+ "string",
1484
+ "null"
1485
+ ],
1486
+ "maxLength": 100,
1487
+ "description": "Shown title. Clients fill it in from `Attachment.tags` of the upload and let the user edit it."
1488
+ },
1489
+ "artist": {
1490
+ "type": [
1491
+ "string",
1492
+ "null"
1493
+ ],
1494
+ "maxLength": 100,
1495
+ "description": "Shown artist, filled in the same way."
1496
+ }
1497
+ }
1498
+ },
1499
+ "UserPage": {
1500
+ "type": "object",
1501
+ "required": [
1502
+ "items",
1503
+ "next_cursor"
1504
+ ],
1505
+ "properties": {
1506
+ "items": {
1507
+ "type": "array",
1508
+ "items": {
1509
+ "$ref": "#/$defs/User"
1510
+ }
1041
1511
  },
1042
1512
  "next_cursor": {
1043
1513
  "$ref": "#/$defs/Cursor"
@@ -1088,9 +1558,13 @@
1088
1558
  },
1089
1559
  "UploadPurpose": {
1090
1560
  "type": "string",
1561
+ "description": "`sticker`: a PNG, JPEG or still WebP of at most 5 MB. The server fits it into 512 x 512 px with a transparent\nborder and stores a WebP (`413` when that is still over 512 KB). Only its uploader can load it until it is\nadded to a pack.\n\n`profile_music`: an audio file of at most 20 MB. The server keeps at most 30 s of it (from `start_ms` to\n`end_ms`, or the first 30 s), stored as AAC, reads the title and artist into `tags` and the embedded cover\ninto `thumbnail_url`. Use it with `PUT /me/music`.\n\n`profile_background`: an image (10 MB), an animated GIF (15 MB) or a video of at most 15 s (15 MB). Use it\nwith `PUT /me/background` or `PUT /groups/{chat_id}/background`.\n",
1091
1562
  "enum": [
1092
1563
  "message",
1093
- "avatar"
1564
+ "avatar",
1565
+ "sticker",
1566
+ "profile_music",
1567
+ "profile_background"
1094
1568
  ]
1095
1569
  },
1096
1570
  "UploadAttachmentRequest": {
@@ -1124,6 +1598,16 @@
1124
1598
  "minimum": 0,
1125
1599
  "maximum": 255
1126
1600
  }
1601
+ },
1602
+ "start_ms": {
1603
+ "type": "integer",
1604
+ "minimum": 0,
1605
+ "description": "`profile_music` only: where the kept part starts."
1606
+ },
1607
+ "end_ms": {
1608
+ "type": "integer",
1609
+ "minimum": 1,
1610
+ "description": "`profile_music` only: where the kept part ends, at most 30 s after `start_ms`."
1127
1611
  }
1128
1612
  }
1129
1613
  },
@@ -1182,6 +1666,14 @@
1182
1666
  ],
1183
1667
  "readOnly": true
1184
1668
  },
1669
+ "display_url": {
1670
+ "type": [
1671
+ "string",
1672
+ "null"
1673
+ ],
1674
+ "readOnly": true,
1675
+ "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."
1676
+ },
1185
1677
  "duration_ms": {
1186
1678
  "type": [
1187
1679
  "integer",
@@ -1199,724 +1691,2775 @@
1199
1691
  "minimum": 0,
1200
1692
  "maximum": 255
1201
1693
  }
1202
- }
1203
- }
1204
- },
1205
- "MediaKind": {
1206
- "type": "string",
1207
- "enum": [
1208
- "image",
1209
- "audio"
1210
- ]
1211
- },
1212
- "MessageType": {
1213
- "type": "string",
1214
- "enum": [
1215
- "text",
1216
- "file",
1217
- "voice",
1218
- "system"
1219
- ]
1220
- },
1221
- "Reaction": {
1222
- "type": "object",
1223
- "required": [
1224
- "emoji",
1225
- "user_id"
1226
- ],
1227
- "properties": {
1228
- "emoji": {
1229
- "type": "string",
1230
- "minLength": 1,
1231
- "maxLength": 32
1232
1694
  },
1233
- "user_id": {
1234
- "$ref": "#/$defs/Id"
1695
+ "tags": {
1696
+ "description": "Only in the answer to a `profile_music` upload; what the file says about itself.",
1697
+ "$ref": "#/$defs/AudioTags"
1698
+ },
1699
+ "drawing": {
1700
+ "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",
1701
+ "$ref": "#/$defs/Drawing"
1235
1702
  }
1236
1703
  }
1237
1704
  },
1238
- "ReadReceipt": {
1705
+ "AudioTags": {
1239
1706
  "type": "object",
1240
1707
  "required": [
1241
- "user_id",
1242
- "read_at"
1708
+ "title",
1709
+ "artist"
1243
1710
  ],
1244
1711
  "properties": {
1245
- "user_id": {
1246
- "$ref": "#/$defs/Id"
1712
+ "title": {
1713
+ "type": [
1714
+ "string",
1715
+ "null"
1716
+ ],
1717
+ "maxLength": 100
1247
1718
  },
1248
- "read_at": {
1249
- "$ref": "#/$defs/Timestamp"
1719
+ "artist": {
1720
+ "type": [
1721
+ "string",
1722
+ "null"
1723
+ ],
1724
+ "maxLength": 100
1250
1725
  }
1251
1726
  }
1252
1727
  },
1253
- "ForwardedFrom": {
1728
+ "Drawing": {
1254
1729
  "type": "object",
1730
+ "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",
1255
1731
  "required": [
1256
- "message_id",
1257
- "sender_id",
1258
- "sender_name"
1732
+ "version",
1733
+ "items"
1259
1734
  ],
1735
+ "additionalProperties": false,
1260
1736
  "properties": {
1261
- "message_id": {
1262
- "$ref": "#/$defs/Id"
1263
- },
1264
- "sender_id": {
1265
- "oneOf": [
1266
- {
1267
- "$ref": "#/$defs/Id"
1268
- },
1269
- {
1270
- "type": "null"
1271
- }
1272
- ]
1737
+ "version": {
1738
+ "type": "integer",
1739
+ "minimum": 1,
1740
+ "maximum": 1
1273
1741
  },
1274
- "sender_name": {
1275
- "type": "string"
1742
+ "items": {
1743
+ "type": "array",
1744
+ "minItems": 1,
1745
+ "maxItems": 200,
1746
+ "items": {
1747
+ "$ref": "#/$defs/DrawingItem"
1748
+ }
1276
1749
  }
1277
1750
  }
1278
1751
  },
1279
- "Message": {
1752
+ "DrawingItem": {
1280
1753
  "type": "object",
1281
1754
  "required": [
1282
- "id",
1283
- "chat_id",
1284
1755
  "type",
1285
- "sender",
1286
- "content",
1287
- "attachment",
1288
- "reply_to",
1289
- "forwarded_from",
1290
- "reactions",
1291
- "read_by",
1292
- "created_at",
1293
- "edited_at",
1294
- "is_deleted"
1756
+ "color"
1295
1757
  ],
1758
+ "additionalProperties": false,
1296
1759
  "properties": {
1297
- "id": {
1298
- "$ref": "#/$defs/Id"
1299
- },
1300
- "chat_id": {
1301
- "$ref": "#/$defs/Id"
1302
- },
1303
1760
  "type": {
1304
- "$ref": "#/$defs/MessageType"
1305
- },
1306
- "sender": {
1307
- "description": "`null` for system messages.",
1308
- "oneOf": [
1309
- {
1310
- "$ref": "#/$defs/User"
1311
- },
1312
- {
1313
- "type": "null"
1314
- }
1761
+ "type": "string",
1762
+ "enum": [
1763
+ "stroke",
1764
+ "text"
1315
1765
  ]
1316
1766
  },
1317
- "content": {
1318
- "type": [
1319
- "string",
1320
- "null"
1321
- ],
1322
- "maxLength": 4096,
1323
- "description": "Text, or the caption of a file; `null` when deleted."
1767
+ "color": {
1768
+ "type": "string",
1769
+ "pattern": "^#[0-9a-fA-F]{6}$"
1324
1770
  },
1325
- "attachment": {
1326
- "oneOf": [
1327
- {
1328
- "$ref": "#/$defs/Attachment"
1329
- },
1330
- {
1331
- "type": "null"
1332
- }
1333
- ]
1771
+ "width": {
1772
+ "type": "number",
1773
+ "format": "double",
1774
+ "minimum": 0.001,
1775
+ "maximum": 0.2,
1776
+ "description": "Stroke only. Line width as a fraction of the image width."
1334
1777
  },
1335
- "reply_to": {
1336
- "oneOf": [
1778
+ "points": {
1779
+ "type": "array",
1780
+ "minItems": 2,
1781
+ "maxItems": 10000,
1782
+ "description": "Stroke only. Flat list of x, y pairs. A drawing has at most 10000 numbers in all its strokes.",
1783
+ "items": {
1784
+ "type": "number",
1785
+ "format": "double",
1786
+ "minimum": 0,
1787
+ "maximum": 1
1788
+ }
1789
+ },
1790
+ "x": {
1791
+ "type": "number",
1792
+ "format": "double",
1793
+ "minimum": 0,
1794
+ "maximum": 1,
1795
+ "description": "Text only. Left edge of the label."
1796
+ },
1797
+ "y": {
1798
+ "type": "number",
1799
+ "format": "double",
1800
+ "minimum": 0,
1801
+ "maximum": 1,
1802
+ "description": "Text only. Top edge of the label."
1803
+ },
1804
+ "size": {
1805
+ "type": "number",
1806
+ "format": "double",
1807
+ "minimum": 0.01,
1808
+ "maximum": 0.5,
1809
+ "description": "Text only. Font height as a fraction of the image height."
1810
+ },
1811
+ "text": {
1812
+ "type": "string",
1813
+ "minLength": 1,
1814
+ "maxLength": 200,
1815
+ "description": "Text only."
1816
+ }
1817
+ },
1818
+ "if": {
1819
+ "properties": {
1820
+ "type": {
1821
+ "const": "stroke"
1822
+ }
1823
+ }
1824
+ },
1825
+ "then": {
1826
+ "required": [
1827
+ "width",
1828
+ "points"
1829
+ ],
1830
+ "properties": {
1831
+ "width": {
1832
+ "type": "number"
1833
+ },
1834
+ "points": {
1835
+ "type": "array"
1836
+ },
1837
+ "x": {
1838
+ "not": {}
1839
+ },
1840
+ "y": {
1841
+ "not": {}
1842
+ },
1843
+ "size": {
1844
+ "not": {}
1845
+ },
1846
+ "text": {
1847
+ "not": {}
1848
+ }
1849
+ }
1850
+ },
1851
+ "else": {
1852
+ "required": [
1853
+ "x",
1854
+ "y",
1855
+ "size",
1856
+ "text"
1857
+ ],
1858
+ "properties": {
1859
+ "x": {
1860
+ "type": "number"
1861
+ },
1862
+ "y": {
1863
+ "type": "number"
1864
+ },
1865
+ "size": {
1866
+ "type": "number"
1867
+ },
1868
+ "text": {
1869
+ "type": "string"
1870
+ },
1871
+ "width": {
1872
+ "not": {}
1873
+ },
1874
+ "points": {
1875
+ "not": {}
1876
+ }
1877
+ }
1878
+ }
1879
+ },
1880
+ "AttachmentDrawing": {
1881
+ "type": "object",
1882
+ "required": [
1883
+ "attachment_id",
1884
+ "drawing"
1885
+ ],
1886
+ "additionalProperties": false,
1887
+ "properties": {
1888
+ "attachment_id": {
1889
+ "$ref": "#/$defs/AttachmentRef"
1890
+ },
1891
+ "drawing": {
1892
+ "$ref": "#/$defs/Drawing"
1893
+ }
1894
+ }
1895
+ },
1896
+ "MediaKind": {
1897
+ "type": "string",
1898
+ "description": "`image` photos, `visual` photos and videos, `audio` audio files and voice messages, `voice` voice messages only,\n`file` other files (documents, archives), `link` messages whose text or caption contains a web link.\n",
1899
+ "enum": [
1900
+ "image",
1901
+ "audio",
1902
+ "visual",
1903
+ "file",
1904
+ "voice",
1905
+ "link"
1906
+ ]
1907
+ },
1908
+ "MessageType": {
1909
+ "type": "string",
1910
+ "enum": [
1911
+ "text",
1912
+ "file",
1913
+ "voice",
1914
+ "system",
1915
+ "sticker"
1916
+ ]
1917
+ },
1918
+ "Sticker": {
1919
+ "type": "object",
1920
+ "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",
1921
+ "required": [
1922
+ "id",
1923
+ "pack_id",
1924
+ "emoji",
1925
+ "is_animated",
1926
+ "image"
1927
+ ],
1928
+ "properties": {
1929
+ "id": {
1930
+ "$ref": "#/$defs/Id"
1931
+ },
1932
+ "pack_id": {
1933
+ "$ref": "#/$defs/Id"
1934
+ },
1935
+ "pack_slug": {
1936
+ "allOf": [
1937
+ {
1938
+ "$ref": "#/$defs/StickerPackSlug"
1939
+ }
1940
+ ],
1941
+ "description": "The share link of the sticker's pack when a user made it; missing for built-in packs. A client that\nshows the pack of a sticker someone sent opens it with `GET /stickers/links/{slug}`.\n"
1942
+ },
1943
+ "emoji": {
1944
+ "type": "string",
1945
+ "minLength": 1,
1946
+ "maxLength": 32,
1947
+ "description": "The emoji the sticker stands for, for previews, notifications and search."
1948
+ },
1949
+ "is_animated": {
1950
+ "type": "boolean"
1951
+ },
1952
+ "image": {
1953
+ "$ref": "#/$defs/Attachment"
1954
+ }
1955
+ }
1956
+ },
1957
+ "StickerPackSlug": {
1958
+ "type": "string",
1959
+ "pattern": "^[A-Za-z0-9]{8,32}$"
1960
+ },
1961
+ "StickerPack": {
1962
+ "type": "object",
1963
+ "required": [
1964
+ "id",
1965
+ "title",
1966
+ "is_official",
1967
+ "is_installed",
1968
+ "is_mine",
1969
+ "is_hidden",
1970
+ "stickers",
1971
+ "version"
1972
+ ],
1973
+ "properties": {
1974
+ "id": {
1975
+ "$ref": "#/$defs/Id"
1976
+ },
1977
+ "version": {
1978
+ "type": "integer",
1979
+ "minimum": 0,
1980
+ "description": "Grows whenever the title or the stickers of the pack change."
1981
+ },
1982
+ "title": {
1983
+ "type": "string",
1984
+ "minLength": 1,
1985
+ "maxLength": 64
1986
+ },
1987
+ "is_official": {
1988
+ "type": "boolean",
1989
+ "description": "A built-in pack of the messenger, not made by a user."
1990
+ },
1991
+ "is_installed": {
1992
+ "type": "boolean",
1993
+ "description": "The pack is in the user's sticker panel."
1994
+ },
1995
+ "is_mine": {
1996
+ "type": "boolean",
1997
+ "description": "The user made the pack and may change it."
1998
+ },
1999
+ "is_hidden": {
2000
+ "type": "boolean",
2001
+ "description": "Hidden after reports; only the owner sees such a pack, and nobody can send from it."
2002
+ },
2003
+ "owner_id": {
2004
+ "$ref": "#/$defs/Id"
2005
+ },
2006
+ "slug": {
2007
+ "allOf": [
2008
+ {
2009
+ "$ref": "#/$defs/StickerPackSlug"
2010
+ }
2011
+ ],
2012
+ "description": "The share link of a pack a user made; missing for built-in packs."
2013
+ },
2014
+ "stickers": {
2015
+ "type": "array",
2016
+ "maxItems": 120,
2017
+ "items": {
2018
+ "$ref": "#/$defs/Sticker"
2019
+ }
2020
+ }
2021
+ }
2022
+ },
2023
+ "StickerPackList": {
2024
+ "type": "object",
2025
+ "required": [
2026
+ "items"
2027
+ ],
2028
+ "properties": {
2029
+ "items": {
2030
+ "type": "array",
2031
+ "maxItems": 200,
2032
+ "items": {
2033
+ "$ref": "#/$defs/StickerPack"
2034
+ }
2035
+ }
2036
+ }
2037
+ },
2038
+ "CreateStickerPackRequest": {
2039
+ "type": "object",
2040
+ "additionalProperties": false,
2041
+ "required": [
2042
+ "title"
2043
+ ],
2044
+ "properties": {
2045
+ "title": {
2046
+ "type": "string",
2047
+ "minLength": 1,
2048
+ "maxLength": 64
2049
+ }
2050
+ }
2051
+ },
2052
+ "UpdateStickerPackRequest": {
2053
+ "type": "object",
2054
+ "additionalProperties": false,
2055
+ "required": [
2056
+ "title"
2057
+ ],
2058
+ "properties": {
2059
+ "title": {
2060
+ "type": "string",
2061
+ "minLength": 1,
2062
+ "maxLength": 64
2063
+ }
2064
+ }
2065
+ },
2066
+ "AddStickerRequest": {
2067
+ "type": "object",
2068
+ "additionalProperties": false,
2069
+ "required": [
2070
+ "attachment_id",
2071
+ "emoji"
2072
+ ],
2073
+ "properties": {
2074
+ "attachment_id": {
2075
+ "$ref": "#/$defs/AttachmentRef"
2076
+ },
2077
+ "emoji": {
2078
+ "type": "string",
2079
+ "minLength": 1,
2080
+ "maxLength": 32
2081
+ }
2082
+ }
2083
+ },
2084
+ "UpdateStickerRequest": {
2085
+ "type": "object",
2086
+ "additionalProperties": false,
2087
+ "required": [
2088
+ "emoji"
2089
+ ],
2090
+ "properties": {
2091
+ "emoji": {
2092
+ "type": "string",
2093
+ "minLength": 1,
2094
+ "maxLength": 32
2095
+ }
2096
+ }
2097
+ },
2098
+ "ReorderStickersRequest": {
2099
+ "type": "object",
2100
+ "additionalProperties": false,
2101
+ "required": [
2102
+ "sticker_ids"
2103
+ ],
2104
+ "properties": {
2105
+ "sticker_ids": {
2106
+ "type": "array",
2107
+ "maxItems": 120,
2108
+ "items": {
2109
+ "$ref": "#/$defs/Id"
2110
+ }
2111
+ }
2112
+ }
2113
+ },
2114
+ "StickerPackReportReason": {
2115
+ "type": "string",
2116
+ "enum": [
2117
+ "spam",
2118
+ "violence",
2119
+ "sexual",
2120
+ "hate",
2121
+ "copyright",
2122
+ "other"
2123
+ ]
2124
+ },
2125
+ "ReportStickerPackRequest": {
2126
+ "type": "object",
2127
+ "additionalProperties": false,
2128
+ "required": [
2129
+ "reason"
2130
+ ],
2131
+ "properties": {
2132
+ "reason": {
2133
+ "$ref": "#/$defs/StickerPackReportReason"
2134
+ }
2135
+ }
2136
+ },
2137
+ "StickerList": {
2138
+ "type": "object",
2139
+ "required": [
2140
+ "items"
2141
+ ],
2142
+ "properties": {
2143
+ "items": {
2144
+ "type": "array",
2145
+ "maxItems": 20,
2146
+ "items": {
2147
+ "$ref": "#/$defs/Sticker"
2148
+ }
2149
+ }
2150
+ }
2151
+ },
2152
+ "Reaction": {
2153
+ "type": "object",
2154
+ "required": [
2155
+ "emoji",
2156
+ "user_id"
2157
+ ],
2158
+ "properties": {
2159
+ "emoji": {
2160
+ "type": "string",
2161
+ "minLength": 1,
2162
+ "maxLength": 32
2163
+ },
2164
+ "user_id": {
2165
+ "$ref": "#/$defs/Id"
2166
+ }
2167
+ }
2168
+ },
2169
+ "ReadReceipt": {
2170
+ "type": "object",
2171
+ "required": [
2172
+ "user_id",
2173
+ "read_at"
2174
+ ],
2175
+ "properties": {
2176
+ "user_id": {
2177
+ "$ref": "#/$defs/Id"
2178
+ },
2179
+ "read_at": {
2180
+ "$ref": "#/$defs/Timestamp"
2181
+ }
2182
+ }
2183
+ },
2184
+ "ForwardedFrom": {
2185
+ "type": "object",
2186
+ "required": [
2187
+ "message_id",
2188
+ "sender_id",
2189
+ "sender_name"
2190
+ ],
2191
+ "properties": {
2192
+ "message_id": {
2193
+ "$ref": "#/$defs/Id"
2194
+ },
2195
+ "sender_id": {
2196
+ "oneOf": [
2197
+ {
2198
+ "$ref": "#/$defs/Id"
2199
+ },
2200
+ {
2201
+ "type": "null"
2202
+ }
2203
+ ]
2204
+ },
2205
+ "sender_name": {
2206
+ "type": "string"
2207
+ }
2208
+ }
2209
+ },
2210
+ "ReplyPreview": {
2211
+ "type": "object",
2212
+ "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",
2213
+ "required": [
2214
+ "id",
2215
+ "type",
2216
+ "sender",
2217
+ "content",
2218
+ "attachment",
2219
+ "is_deleted"
2220
+ ],
2221
+ "properties": {
2222
+ "id": {
2223
+ "$ref": "#/$defs/Id"
2224
+ },
2225
+ "type": {
2226
+ "$ref": "#/$defs/MessageType"
2227
+ },
2228
+ "sender": {
2229
+ "oneOf": [
2230
+ {
2231
+ "$ref": "#/$defs/User"
2232
+ },
2233
+ {
2234
+ "type": "null"
2235
+ }
2236
+ ]
2237
+ },
2238
+ "content": {
2239
+ "type": [
2240
+ "string",
2241
+ "null"
2242
+ ],
2243
+ "maxLength": 100,
2244
+ "description": "The first 100 characters of the text or caption; `null` when deleted or empty."
2245
+ },
2246
+ "attachment": {
2247
+ "oneOf": [
2248
+ {
2249
+ "$ref": "#/$defs/Attachment"
2250
+ },
2251
+ {
2252
+ "type": "null"
2253
+ }
2254
+ ]
2255
+ },
2256
+ "is_deleted": {
2257
+ "type": "boolean"
2258
+ }
2259
+ }
2260
+ },
2261
+ "Message": {
2262
+ "type": "object",
2263
+ "required": [
2264
+ "id",
2265
+ "chat_id",
2266
+ "type",
2267
+ "sender",
2268
+ "content",
2269
+ "attachment",
2270
+ "reply_to",
2271
+ "forwarded_from",
2272
+ "reactions",
2273
+ "read_by",
2274
+ "created_at",
2275
+ "edited_at",
2276
+ "is_deleted"
2277
+ ],
2278
+ "properties": {
2279
+ "id": {
2280
+ "$ref": "#/$defs/Id"
2281
+ },
2282
+ "chat_id": {
2283
+ "$ref": "#/$defs/Id"
2284
+ },
2285
+ "type": {
2286
+ "$ref": "#/$defs/MessageType"
2287
+ },
2288
+ "sender": {
2289
+ "description": "`null` for system messages.",
2290
+ "oneOf": [
2291
+ {
2292
+ "$ref": "#/$defs/User"
2293
+ },
2294
+ {
2295
+ "type": "null"
2296
+ }
2297
+ ]
2298
+ },
2299
+ "content": {
2300
+ "type": [
2301
+ "string",
2302
+ "null"
2303
+ ],
2304
+ "maxLength": 4096,
2305
+ "description": "Text, the caption of a file, or the emoji of a sticker; `null` when deleted."
2306
+ },
2307
+ "attachment": {
2308
+ "oneOf": [
2309
+ {
2310
+ "$ref": "#/$defs/Attachment"
2311
+ },
2312
+ {
2313
+ "type": "null"
2314
+ }
2315
+ ]
2316
+ },
2317
+ "reply_to": {
2318
+ "oneOf": [
2319
+ {
2320
+ "$ref": "#/$defs/Id"
2321
+ },
2322
+ {
2323
+ "type": "null"
2324
+ }
2325
+ ]
2326
+ },
2327
+ "reply_preview": {
2328
+ "$ref": "#/$defs/ReplyPreview"
2329
+ },
2330
+ "forwarded_from": {
2331
+ "oneOf": [
2332
+ {
2333
+ "$ref": "#/$defs/ForwardedFrom"
2334
+ },
2335
+ {
2336
+ "type": "null"
2337
+ }
2338
+ ]
2339
+ },
2340
+ "sticker": {
2341
+ "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",
2342
+ "$ref": "#/$defs/Sticker"
2343
+ },
2344
+ "attachments": {
2345
+ "type": "array",
2346
+ "description": "Ordered images and videos of an album. The first item is also returned as attachment for older clients.",
2347
+ "minItems": 2,
2348
+ "maxItems": 10,
2349
+ "items": {
2350
+ "$ref": "#/$defs/Attachment"
2351
+ }
2352
+ },
2353
+ "reactions": {
2354
+ "type": "array",
2355
+ "items": {
2356
+ "$ref": "#/$defs/Reaction"
2357
+ }
2358
+ },
2359
+ "read_by": {
2360
+ "type": "array",
2361
+ "items": {
2362
+ "$ref": "#/$defs/ReadReceipt"
2363
+ }
2364
+ },
2365
+ "created_at": {
2366
+ "$ref": "#/$defs/Timestamp"
2367
+ },
2368
+ "edited_at": {
2369
+ "oneOf": [
2370
+ {
2371
+ "$ref": "#/$defs/Timestamp"
2372
+ },
2373
+ {
2374
+ "type": "null"
2375
+ }
2376
+ ]
2377
+ },
2378
+ "is_deleted": {
2379
+ "type": "boolean"
2380
+ },
2381
+ "system_event": {
2382
+ "$ref": "#/$defs/SystemEvent"
2383
+ },
2384
+ "client_temp_id": {
2385
+ "$ref": "#/$defs/ClientTempId"
2386
+ }
2387
+ }
2388
+ },
2389
+ "LinkPreview": {
2390
+ "type": "object",
2391
+ "required": [
2392
+ "url",
2393
+ "title",
2394
+ "description",
2395
+ "site_name",
2396
+ "image"
2397
+ ],
2398
+ "properties": {
2399
+ "url": {
2400
+ "type": "string",
2401
+ "description": "The page after redirects"
2402
+ },
2403
+ "title": {
2404
+ "type": [
2405
+ "string",
2406
+ "null"
2407
+ ],
2408
+ "maxLength": 300
2409
+ },
2410
+ "description": {
2411
+ "type": [
2412
+ "string",
2413
+ "null"
2414
+ ],
2415
+ "maxLength": 500
2416
+ },
2417
+ "site_name": {
2418
+ "type": [
2419
+ "string",
2420
+ "null"
2421
+ ],
2422
+ "maxLength": 100
2423
+ },
2424
+ "image": {
2425
+ "oneOf": [
2426
+ {
2427
+ "$ref": "#/$defs/LinkPreviewImage"
2428
+ },
2429
+ {
2430
+ "type": "null"
2431
+ }
2432
+ ]
2433
+ }
2434
+ }
2435
+ },
2436
+ "LinkPreviewImage": {
2437
+ "type": "object",
2438
+ "required": [
2439
+ "url",
2440
+ "width",
2441
+ "height"
2442
+ ],
2443
+ "properties": {
2444
+ "url": {
2445
+ "type": "string",
2446
+ "description": "`GET /link-preview/image` with the signed address of the page's image"
2447
+ },
2448
+ "width": {
2449
+ "type": [
2450
+ "integer",
2451
+ "null"
2452
+ ],
2453
+ "minimum": 1
2454
+ },
2455
+ "height": {
2456
+ "type": [
2457
+ "integer",
2458
+ "null"
2459
+ ],
2460
+ "minimum": 1
2461
+ }
2462
+ }
2463
+ },
2464
+ "SystemEventKind": {
2465
+ "type": "string",
2466
+ "enum": [
2467
+ "group_created",
2468
+ "member_added",
2469
+ "member_joined",
2470
+ "member_removed",
2471
+ "member_left",
2472
+ "call"
2473
+ ]
2474
+ },
2475
+ "SystemEvent": {
2476
+ "type": "object",
2477
+ "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",
2478
+ "required": [
2479
+ "kind",
2480
+ "actor_id",
2481
+ "actor_name"
2482
+ ],
2483
+ "properties": {
2484
+ "kind": {
2485
+ "$ref": "#/$defs/SystemEventKind"
2486
+ },
2487
+ "actor_id": {
2488
+ "oneOf": [
2489
+ {
2490
+ "$ref": "#/$defs/Id"
2491
+ },
2492
+ {
2493
+ "type": "null"
2494
+ }
2495
+ ]
2496
+ },
2497
+ "actor_name": {
2498
+ "type": "string"
2499
+ },
2500
+ "target_id": {
2501
+ "$ref": "#/$defs/Id"
2502
+ },
2503
+ "target_name": {
2504
+ "type": "string"
2505
+ },
2506
+ "call": {
2507
+ "$ref": "#/$defs/CallSummary"
2508
+ }
2509
+ }
2510
+ },
2511
+ "MessagePage": {
2512
+ "type": "object",
2513
+ "required": [
2514
+ "items",
2515
+ "next_cursor",
2516
+ "prev_cursor"
2517
+ ],
2518
+ "properties": {
2519
+ "items": {
2520
+ "type": "array",
2521
+ "description": "Oldest to newest",
2522
+ "items": {
2523
+ "$ref": "#/$defs/Message"
2524
+ }
2525
+ },
2526
+ "next_cursor": {
2527
+ "description": "Continues in the direction of the request: pass it as `before` (older) for the\ndefault, `before` and `around` requests, or as `after` (newer) for `after` requests.\n",
2528
+ "oneOf": [
2529
+ {
2530
+ "$ref": "#/$defs/Id"
2531
+ },
2532
+ {
2533
+ "type": "null"
2534
+ }
2535
+ ]
2536
+ },
2537
+ "prev_cursor": {
2538
+ "description": "The opposite direction (`after` for the default request, `before` for an `after` request).",
2539
+ "oneOf": [
2540
+ {
2541
+ "$ref": "#/$defs/Id"
2542
+ },
2543
+ {
2544
+ "type": "null"
2545
+ }
2546
+ ]
2547
+ }
2548
+ }
2549
+ },
2550
+ "SearchHit": {
2551
+ "type": "object",
2552
+ "required": [
2553
+ "message"
2554
+ ],
2555
+ "properties": {
2556
+ "message": {
2557
+ "$ref": "#/$defs/Message"
2558
+ },
2559
+ "highlight": {
2560
+ "type": [
2561
+ "string",
2562
+ "null"
2563
+ ],
2564
+ "description": "Plain-text excerpt of the matching text or file name; never HTML. The matched words are\nwrapped in U+E000 (start) and U+E001 (end), characters of the Unicode private use area,\nso a client can mark them without parsing markup. `null` when the message matched without\nan excerpt.\n"
2565
+ }
2566
+ }
2567
+ },
2568
+ "UnsentMessage": {
2569
+ "type": "object",
2570
+ "description": "A send the server rejected for a reason that may pass later. Resend it with the same `client_temp_id`.",
2571
+ "required": [
2572
+ "chat_id",
2573
+ "client_temp_id",
2574
+ "type",
2575
+ "content",
2576
+ "reply_to",
2577
+ "attachments",
2578
+ "error_code",
2579
+ "created_at"
2580
+ ],
2581
+ "properties": {
2582
+ "chat_id": {
2583
+ "$ref": "#/$defs/Id"
2584
+ },
2585
+ "client_temp_id": {
2586
+ "$ref": "#/$defs/ClientTempId"
2587
+ },
2588
+ "type": {
2589
+ "type": "string",
2590
+ "enum": [
2591
+ "text",
2592
+ "file",
2593
+ "voice",
2594
+ "sticker"
2595
+ ]
2596
+ },
2597
+ "content": {
2598
+ "type": [
2599
+ "string",
2600
+ "null"
2601
+ ]
2602
+ },
2603
+ "reply_to": {
2604
+ "oneOf": [
2605
+ {
2606
+ "$ref": "#/$defs/Id"
2607
+ },
2608
+ {
2609
+ "type": "null"
2610
+ }
2611
+ ]
2612
+ },
2613
+ "attachments": {
2614
+ "type": "array",
2615
+ "description": "Uploaded files of the send that still exist, in the order they were sent.",
2616
+ "items": {
2617
+ "$ref": "#/$defs/Attachment"
2618
+ }
2619
+ },
2620
+ "sticker": {
2621
+ "$ref": "#/$defs/Sticker"
2622
+ },
2623
+ "error_code": {
2624
+ "$ref": "#/$defs/ErrorCode"
2625
+ },
2626
+ "created_at": {
2627
+ "$ref": "#/$defs/Timestamp"
2628
+ }
2629
+ }
2630
+ },
2631
+ "MessageSearchPage": {
2632
+ "type": "object",
2633
+ "required": [
2634
+ "items",
2635
+ "next_cursor"
2636
+ ],
2637
+ "properties": {
2638
+ "items": {
2639
+ "type": "array",
2640
+ "items": {
2641
+ "$ref": "#/$defs/SearchHit"
2642
+ }
2643
+ },
2644
+ "next_cursor": {
2645
+ "$ref": "#/$defs/Cursor"
2646
+ }
2647
+ }
2648
+ },
2649
+ "SendMessageRequest": {
2650
+ "type": "object",
2651
+ "required": [
2652
+ "client_temp_id",
2653
+ "type"
2654
+ ],
2655
+ "properties": {
2656
+ "client_temp_id": {
2657
+ "$ref": "#/$defs/ClientTempId"
2658
+ },
2659
+ "type": {
2660
+ "type": "string",
2661
+ "enum": [
2662
+ "text",
2663
+ "file",
2664
+ "voice",
2665
+ "sticker"
2666
+ ]
2667
+ },
2668
+ "content": {
2669
+ "type": [
2670
+ "string",
2671
+ "null"
2672
+ ],
2673
+ "maxLength": 4096
2674
+ },
2675
+ "sticker_id": {
2676
+ "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",
2677
+ "$ref": "#/$defs/Id"
2678
+ },
2679
+ "attachment_id": {
2680
+ "description": "Single upload ID for a file or voice message. Omit for albums.",
2681
+ "oneOf": [
2682
+ {
2683
+ "$ref": "#/$defs/AttachmentRef"
2684
+ },
2685
+ {
2686
+ "type": "null"
2687
+ }
2688
+ ]
2689
+ },
2690
+ "attachment_ids": {
2691
+ "type": "array",
2692
+ "description": "Ordered IDs of two to ten image or video uploads for one file message.",
2693
+ "minItems": 2,
2694
+ "maxItems": 10,
2695
+ "uniqueItems": true,
2696
+ "items": {
2697
+ "$ref": "#/$defs/AttachmentRef"
2698
+ }
2699
+ },
2700
+ "reply_to": {
2701
+ "oneOf": [
2702
+ {
2703
+ "$ref": "#/$defs/Id"
2704
+ },
2705
+ {
2706
+ "type": "null"
2707
+ }
2708
+ ]
2709
+ },
2710
+ "drawings": {
2711
+ "type": "array",
2712
+ "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",
2713
+ "maxItems": 10,
2714
+ "items": {
2715
+ "$ref": "#/$defs/AttachmentDrawing"
2716
+ }
2717
+ }
2718
+ },
2719
+ "if": {
2720
+ "properties": {
2721
+ "type": {
2722
+ "enum": [
2723
+ "file",
2724
+ "voice"
2725
+ ]
2726
+ }
2727
+ }
2728
+ },
2729
+ "then": {
2730
+ "properties": {
2731
+ "sticker_id": {
2732
+ "not": {}
2733
+ }
2734
+ },
2735
+ "oneOf": [
2736
+ {
2737
+ "required": [
2738
+ "attachment_id"
2739
+ ],
2740
+ "properties": {
2741
+ "attachment_id": {
2742
+ "$ref": "#/$defs/AttachmentRef"
2743
+ },
2744
+ "attachment_ids": {
2745
+ "not": {}
2746
+ }
2747
+ }
2748
+ },
2749
+ {
2750
+ "required": [
2751
+ "attachment_ids"
2752
+ ],
2753
+ "properties": {
2754
+ "type": {
2755
+ "const": "file"
2756
+ },
2757
+ "attachment_id": {
2758
+ "not": {}
2759
+ },
2760
+ "attachment_ids": {
2761
+ "type": "array"
2762
+ }
2763
+ }
2764
+ }
2765
+ ]
2766
+ },
2767
+ "else": {
2768
+ "if": {
2769
+ "properties": {
2770
+ "type": {
2771
+ "const": "sticker"
2772
+ }
2773
+ }
2774
+ },
2775
+ "then": {
2776
+ "required": [
2777
+ "sticker_id"
2778
+ ],
2779
+ "properties": {
2780
+ "sticker_id": {
2781
+ "$ref": "#/$defs/Id"
2782
+ },
2783
+ "content": {
2784
+ "not": {}
2785
+ },
2786
+ "attachment_id": {
2787
+ "not": {}
2788
+ },
2789
+ "attachment_ids": {
2790
+ "not": {}
2791
+ },
2792
+ "drawings": {
2793
+ "not": {}
2794
+ }
2795
+ }
2796
+ },
2797
+ "else": {
2798
+ "required": [
2799
+ "content"
2800
+ ],
2801
+ "properties": {
2802
+ "content": {
2803
+ "type": "string",
2804
+ "minLength": 1,
2805
+ "maxLength": 4096
2806
+ },
2807
+ "attachment_id": {
2808
+ "not": {}
2809
+ },
2810
+ "attachment_ids": {
2811
+ "not": {}
2812
+ },
2813
+ "drawings": {
2814
+ "not": {}
2815
+ },
2816
+ "sticker_id": {
2817
+ "not": {}
2818
+ }
2819
+ }
2820
+ }
2821
+ }
2822
+ },
2823
+ "EditMessageRequest": {
2824
+ "type": "object",
2825
+ "required": [
2826
+ "content"
2827
+ ],
2828
+ "properties": {
2829
+ "content": {
2830
+ "type": "string",
2831
+ "maxLength": 4096,
2832
+ "description": "New text, or the new caption of a file. Empty removes a file's caption; a text message rejects it."
2833
+ }
2834
+ }
2835
+ },
2836
+ "ForwardMessageRequest": {
2837
+ "type": "object",
2838
+ "required": [
2839
+ "chat_ids"
2840
+ ],
2841
+ "properties": {
2842
+ "chat_ids": {
2843
+ "type": "array",
2844
+ "minItems": 1,
2845
+ "maxItems": 20,
2846
+ "uniqueItems": true,
2847
+ "items": {
2848
+ "$ref": "#/$defs/Id"
2849
+ }
2850
+ }
2851
+ }
2852
+ },
2853
+ "ForwardMessagesRequest": {
2854
+ "type": "object",
2855
+ "required": [
2856
+ "message_ids",
2857
+ "chat_ids"
2858
+ ],
2859
+ "properties": {
2860
+ "message_ids": {
2861
+ "type": "array",
2862
+ "minItems": 1,
2863
+ "maxItems": 20,
2864
+ "uniqueItems": true,
2865
+ "items": {
2866
+ "$ref": "#/$defs/Id"
2867
+ }
2868
+ },
2869
+ "chat_ids": {
2870
+ "type": "array",
2871
+ "minItems": 1,
2872
+ "maxItems": 20,
2873
+ "uniqueItems": true,
2874
+ "items": {
2875
+ "$ref": "#/$defs/Id"
2876
+ }
2877
+ }
2878
+ }
2879
+ },
2880
+ "DeleteMessagesRequest": {
2881
+ "type": "object",
2882
+ "required": [
2883
+ "message_ids",
2884
+ "scope"
2885
+ ],
2886
+ "properties": {
2887
+ "message_ids": {
2888
+ "type": "array",
2889
+ "minItems": 1,
2890
+ "maxItems": 100,
2891
+ "uniqueItems": true,
2892
+ "items": {
2893
+ "$ref": "#/$defs/Id"
2894
+ }
2895
+ },
2896
+ "scope": {
2897
+ "type": "string",
2898
+ "enum": [
2899
+ "me",
2900
+ "everyone"
2901
+ ]
2902
+ }
2903
+ }
2904
+ },
2905
+ "MarkReadRequest": {
2906
+ "type": "object",
2907
+ "required": [
2908
+ "message_id"
2909
+ ],
2910
+ "properties": {
2911
+ "message_id": {
2912
+ "description": "Everything up to and including this message is read.",
2913
+ "$ref": "#/$defs/Id"
2914
+ }
2915
+ }
2916
+ },
2917
+ "ChatType": {
2918
+ "type": "string",
2919
+ "enum": [
2920
+ "direct",
2921
+ "group"
2922
+ ]
2923
+ },
2924
+ "GroupRole": {
2925
+ "type": "string",
2926
+ "description": "A moderator may delete other members' messages; owners and admins also manage the group.",
2927
+ "enum": [
2928
+ "owner",
2929
+ "admin",
2930
+ "moderator",
2931
+ "member"
2932
+ ]
2933
+ },
2934
+ "GroupRoleEvent": {
2935
+ "type": "object",
2936
+ "description": "A member got a new role; `owner` means the actor transferred ownership to them.",
2937
+ "required": [
2938
+ "id",
2939
+ "actor",
2940
+ "target",
2941
+ "role",
2942
+ "created_at"
2943
+ ],
2944
+ "properties": {
2945
+ "id": {
2946
+ "$ref": "#/$defs/Id"
2947
+ },
2948
+ "actor": {
2949
+ "description": "`null` when the account is gone.",
2950
+ "oneOf": [
2951
+ {
2952
+ "$ref": "#/$defs/User"
2953
+ },
2954
+ {
2955
+ "type": "null"
2956
+ }
2957
+ ]
2958
+ },
2959
+ "target": {
2960
+ "$ref": "#/$defs/User"
2961
+ },
2962
+ "role": {
2963
+ "$ref": "#/$defs/GroupRole"
2964
+ },
2965
+ "created_at": {
2966
+ "$ref": "#/$defs/Timestamp"
2967
+ }
2968
+ }
2969
+ },
2970
+ "GroupRoleLog": {
2971
+ "type": "object",
2972
+ "required": [
2973
+ "items"
2974
+ ],
2975
+ "properties": {
2976
+ "items": {
2977
+ "type": "array",
2978
+ "description": "Newest first, at most 100",
2979
+ "items": {
2980
+ "$ref": "#/$defs/GroupRoleEvent"
2981
+ }
2982
+ }
2983
+ }
2984
+ },
2985
+ "Chat": {
2986
+ "type": "object",
2987
+ "required": [
2988
+ "id",
2989
+ "type",
2990
+ "name",
2991
+ "avatar_url",
2992
+ "peer",
2993
+ "is_pinned",
2994
+ "pin_position",
2995
+ "is_archived",
2996
+ "unread_count",
2997
+ "first_unread_message_id",
2998
+ "last_read_message_id",
2999
+ "last_message",
3000
+ "created_at"
3001
+ ],
3002
+ "properties": {
3003
+ "id": {
3004
+ "$ref": "#/$defs/Id"
3005
+ },
3006
+ "type": {
3007
+ "$ref": "#/$defs/ChatType"
3008
+ },
3009
+ "name": {
3010
+ "type": "string",
3011
+ "description": "Display name of the peer or the group"
3012
+ },
3013
+ "avatar_url": {
3014
+ "type": [
3015
+ "string",
3016
+ "null"
3017
+ ]
3018
+ },
3019
+ "peer": {
3020
+ "description": "The other user of a direct chat (the caller in their \"Saved Messages\" chat); `null` for groups.",
3021
+ "oneOf": [
3022
+ {
3023
+ "$ref": "#/$defs/User"
3024
+ },
3025
+ {
3026
+ "type": "null"
3027
+ }
3028
+ ]
3029
+ },
3030
+ "is_pinned": {
3031
+ "type": "boolean"
3032
+ },
3033
+ "pin_position": {
3034
+ "description": "Order of a pinned chat among the caller's pinned chats, lowest first; `null` when not pinned.",
3035
+ "type": [
3036
+ "integer",
3037
+ "null"
3038
+ ]
3039
+ },
3040
+ "is_archived": {
3041
+ "type": "boolean",
3042
+ "description": "Whether the caller archived the chat (only for the caller)."
3043
+ },
3044
+ "unread_count": {
3045
+ "type": "integer",
3046
+ "minimum": 0
3047
+ },
3048
+ "first_unread_message_id": {
3049
+ "description": "The oldest message the caller has not read (the same messages `unread_count` counts: not their own,\nnot system messages, not deleted); `null` when nothing is unread. Clients open the chat around it and\nshow the \"new messages\" divider above it.\n",
3050
+ "oneOf": [
3051
+ {
3052
+ "$ref": "#/$defs/Id"
3053
+ },
3054
+ {
3055
+ "type": "null"
3056
+ }
3057
+ ]
3058
+ },
3059
+ "last_read_message_id": {
3060
+ "description": "The caller's read marker (`POST /chats/{chat_id}/read`); `null` before their first read.",
3061
+ "oneOf": [
3062
+ {
3063
+ "$ref": "#/$defs/Id"
3064
+ },
3065
+ {
3066
+ "type": "null"
3067
+ }
3068
+ ]
3069
+ },
3070
+ "last_message": {
3071
+ "oneOf": [
3072
+ {
3073
+ "$ref": "#/$defs/Message"
3074
+ },
3075
+ {
3076
+ "type": "null"
3077
+ }
3078
+ ]
3079
+ },
3080
+ "my_role": {
3081
+ "description": "Only for groups.",
3082
+ "oneOf": [
3083
+ {
3084
+ "$ref": "#/$defs/GroupRole"
3085
+ },
3086
+ {
3087
+ "type": "null"
3088
+ }
3089
+ ]
3090
+ },
3091
+ "created_at": {
3092
+ "$ref": "#/$defs/Timestamp"
3093
+ }
3094
+ }
3095
+ },
3096
+ "ChatPage": {
3097
+ "type": "object",
3098
+ "required": [
3099
+ "items",
3100
+ "next_cursor"
3101
+ ],
3102
+ "properties": {
3103
+ "items": {
3104
+ "type": "array",
3105
+ "items": {
3106
+ "$ref": "#/$defs/Chat"
3107
+ }
3108
+ },
3109
+ "next_cursor": {
3110
+ "$ref": "#/$defs/Cursor"
3111
+ }
3112
+ }
3113
+ },
3114
+ "ClearHistoryRequest": {
3115
+ "type": "object",
3116
+ "required": [
3117
+ "scope"
3118
+ ],
3119
+ "properties": {
3120
+ "scope": {
3121
+ "type": "string",
3122
+ "enum": [
3123
+ "me",
3124
+ "everyone"
3125
+ ]
3126
+ }
3127
+ }
3128
+ },
3129
+ "PinOrderRequest": {
3130
+ "type": "object",
3131
+ "required": [
3132
+ "chat_ids"
3133
+ ],
3134
+ "properties": {
3135
+ "chat_ids": {
3136
+ "type": "array",
3137
+ "maxItems": 10,
3138
+ "uniqueItems": true,
3139
+ "items": {
3140
+ "$ref": "#/$defs/Id"
3141
+ }
3142
+ }
3143
+ }
3144
+ },
3145
+ "CreateChatRequest": {
3146
+ "type": "object",
3147
+ "required": [
3148
+ "user_id"
3149
+ ],
3150
+ "properties": {
3151
+ "user_id": {
3152
+ "$ref": "#/$defs/Id"
3153
+ },
3154
+ "initial_message": {
3155
+ "type": [
3156
+ "string",
3157
+ "null"
3158
+ ],
3159
+ "maxLength": 4096
3160
+ }
3161
+ }
3162
+ },
3163
+ "GroupMemberPage": {
3164
+ "type": "object",
3165
+ "required": [
3166
+ "items",
3167
+ "next_cursor",
3168
+ "total"
3169
+ ],
3170
+ "properties": {
3171
+ "items": {
3172
+ "type": "array",
3173
+ "items": {
3174
+ "$ref": "#/$defs/GroupMember"
3175
+ }
3176
+ },
3177
+ "next_cursor": {
3178
+ "$ref": "#/$defs/Cursor"
3179
+ },
3180
+ "total": {
3181
+ "type": "integer",
3182
+ "minimum": 0
3183
+ }
3184
+ }
3185
+ },
3186
+ "CommonGroup": {
3187
+ "type": "object",
3188
+ "required": [
3189
+ "id",
3190
+ "name",
3191
+ "avatar_url",
3192
+ "member_count"
3193
+ ],
3194
+ "properties": {
3195
+ "id": {
3196
+ "$ref": "#/$defs/Id"
3197
+ },
3198
+ "name": {
3199
+ "type": "string"
3200
+ },
3201
+ "avatar_url": {
3202
+ "type": [
3203
+ "string",
3204
+ "null"
3205
+ ]
3206
+ },
3207
+ "member_count": {
3208
+ "type": "integer",
3209
+ "minimum": 1
3210
+ }
3211
+ }
3212
+ },
3213
+ "CommonGroupPage": {
3214
+ "type": "object",
3215
+ "required": [
3216
+ "items",
3217
+ "next_cursor"
3218
+ ],
3219
+ "properties": {
3220
+ "items": {
3221
+ "type": "array",
3222
+ "items": {
3223
+ "$ref": "#/$defs/CommonGroup"
3224
+ }
3225
+ },
3226
+ "next_cursor": {
3227
+ "$ref": "#/$defs/Cursor"
3228
+ }
3229
+ }
3230
+ },
3231
+ "GroupMember": {
3232
+ "type": "object",
3233
+ "required": [
3234
+ "user",
3235
+ "role",
3236
+ "joined_at"
3237
+ ],
3238
+ "properties": {
3239
+ "user": {
3240
+ "$ref": "#/$defs/User"
3241
+ },
3242
+ "role": {
3243
+ "$ref": "#/$defs/GroupRole"
3244
+ },
3245
+ "joined_at": {
3246
+ "$ref": "#/$defs/Timestamp"
3247
+ }
3248
+ }
3249
+ },
3250
+ "Group": {
3251
+ "type": "object",
3252
+ "required": [
3253
+ "id",
3254
+ "name",
3255
+ "description",
3256
+ "avatar_url",
3257
+ "background",
3258
+ "owner_id",
3259
+ "my_role",
3260
+ "members",
3261
+ "created_at"
3262
+ ],
3263
+ "properties": {
3264
+ "id": {
3265
+ "$ref": "#/$defs/Id"
3266
+ },
3267
+ "name": {
3268
+ "type": "string",
3269
+ "minLength": 1,
3270
+ "maxLength": 64
3271
+ },
3272
+ "description": {
3273
+ "type": [
3274
+ "string",
3275
+ "null"
3276
+ ],
3277
+ "maxLength": 500
3278
+ },
3279
+ "avatar_url": {
3280
+ "type": [
3281
+ "string",
3282
+ "null"
3283
+ ]
3284
+ },
3285
+ "background": {
3286
+ "description": "The banner and page background of the group profile; set by the owner and admins.",
3287
+ "oneOf": [
1337
3288
  {
1338
- "$ref": "#/$defs/Id"
3289
+ "$ref": "#/$defs/ProfileBackground"
1339
3290
  },
1340
3291
  {
1341
3292
  "type": "null"
1342
3293
  }
1343
3294
  ]
1344
3295
  },
1345
- "forwarded_from": {
1346
- "oneOf": [
1347
- {
1348
- "$ref": "#/$defs/ForwardedFrom"
1349
- },
1350
- {
1351
- "type": "null"
1352
- }
3296
+ "owner_id": {
3297
+ "$ref": "#/$defs/Id"
3298
+ },
3299
+ "my_role": {
3300
+ "$ref": "#/$defs/GroupRole"
3301
+ },
3302
+ "members": {
3303
+ "type": "array",
3304
+ "items": {
3305
+ "$ref": "#/$defs/GroupMember"
3306
+ }
3307
+ },
3308
+ "created_at": {
3309
+ "$ref": "#/$defs/Timestamp"
3310
+ }
3311
+ }
3312
+ },
3313
+ "CreateGroupRequest": {
3314
+ "type": "object",
3315
+ "required": [
3316
+ "name",
3317
+ "member_ids"
3318
+ ],
3319
+ "properties": {
3320
+ "name": {
3321
+ "type": "string",
3322
+ "minLength": 1,
3323
+ "maxLength": 64
3324
+ },
3325
+ "description": {
3326
+ "type": [
3327
+ "string",
3328
+ "null"
3329
+ ],
3330
+ "maxLength": 500
3331
+ },
3332
+ "member_ids": {
3333
+ "type": "array",
3334
+ "maxItems": 200,
3335
+ "uniqueItems": true,
3336
+ "items": {
3337
+ "$ref": "#/$defs/Id"
3338
+ }
3339
+ }
3340
+ }
3341
+ },
3342
+ "UpdateGroupRequest": {
3343
+ "type": "object",
3344
+ "minProperties": 1,
3345
+ "properties": {
3346
+ "name": {
3347
+ "type": "string",
3348
+ "minLength": 1,
3349
+ "maxLength": 64
3350
+ },
3351
+ "description": {
3352
+ "type": [
3353
+ "string",
3354
+ "null"
3355
+ ],
3356
+ "maxLength": 500
3357
+ }
3358
+ }
3359
+ },
3360
+ "AddParticipantRequest": {
3361
+ "type": "object",
3362
+ "required": [
3363
+ "user_id"
3364
+ ],
3365
+ "properties": {
3366
+ "user_id": {
3367
+ "$ref": "#/$defs/Id"
3368
+ }
3369
+ }
3370
+ },
3371
+ "UpdateRoleRequest": {
3372
+ "type": "object",
3373
+ "required": [
3374
+ "role"
3375
+ ],
3376
+ "properties": {
3377
+ "role": {
3378
+ "type": "string",
3379
+ "enum": [
3380
+ "admin",
3381
+ "moderator",
3382
+ "member"
3383
+ ]
3384
+ }
3385
+ }
3386
+ },
3387
+ "TransferOwnerRequest": {
3388
+ "type": "object",
3389
+ "required": [
3390
+ "user_id"
3391
+ ],
3392
+ "properties": {
3393
+ "user_id": {
3394
+ "$ref": "#/$defs/Id"
3395
+ }
3396
+ }
3397
+ },
3398
+ "ApprovalRequestType": {
3399
+ "type": "string",
3400
+ "enum": [
3401
+ "direct_message",
3402
+ "group_invite"
3403
+ ]
3404
+ },
3405
+ "ApprovalRequestStatus": {
3406
+ "type": "string",
3407
+ "enum": [
3408
+ "pending",
3409
+ "approved",
3410
+ "rejected"
3411
+ ]
3412
+ },
3413
+ "ApprovalRequest": {
3414
+ "type": "object",
3415
+ "required": [
3416
+ "id",
3417
+ "type",
3418
+ "status",
3419
+ "requester",
3420
+ "created_at"
3421
+ ],
3422
+ "properties": {
3423
+ "id": {
3424
+ "$ref": "#/$defs/Id"
3425
+ },
3426
+ "type": {
3427
+ "$ref": "#/$defs/ApprovalRequestType"
3428
+ },
3429
+ "status": {
3430
+ "$ref": "#/$defs/ApprovalRequestStatus"
3431
+ },
3432
+ "requester": {
3433
+ "$ref": "#/$defs/User"
3434
+ },
3435
+ "group_name": {
3436
+ "type": [
3437
+ "string",
3438
+ "null"
3439
+ ],
3440
+ "description": "Only for `group_invite`"
3441
+ },
3442
+ "preview": {
3443
+ "type": [
3444
+ "string",
3445
+ "null"
3446
+ ],
3447
+ "description": "First message of a direct-message request"
3448
+ },
3449
+ "created_at": {
3450
+ "$ref": "#/$defs/Timestamp"
3451
+ }
3452
+ }
3453
+ },
3454
+ "DeviceRecoveryStart": {
3455
+ "type": "object",
3456
+ "required": [
3457
+ "username"
3458
+ ],
3459
+ "properties": {
3460
+ "username": {
3461
+ "$ref": "#/$defs/Username"
3462
+ }
3463
+ }
3464
+ },
3465
+ "DeviceRecoveryResult": {
3466
+ "type": "object",
3467
+ "required": [
3468
+ "request_id",
3469
+ "match_number",
3470
+ "expires_at"
3471
+ ],
3472
+ "properties": {
3473
+ "request_id": {
3474
+ "type": "string",
3475
+ "minLength": 32,
3476
+ "maxLength": 128,
3477
+ "pattern": "^[A-Za-z0-9_-]+$"
3478
+ },
3479
+ "match_number": {
3480
+ "type": "integer",
3481
+ "minimum": 10,
3482
+ "maximum": 99
3483
+ },
3484
+ "expires_at": {
3485
+ "type": "string",
3486
+ "format": "date-time"
3487
+ }
3488
+ }
3489
+ },
3490
+ "DeviceRecoveryStatus": {
3491
+ "type": "object",
3492
+ "required": [
3493
+ "status"
3494
+ ],
3495
+ "properties": {
3496
+ "status": {
3497
+ "type": "string",
3498
+ "enum": [
3499
+ "pending",
3500
+ "approved",
3501
+ "denied",
3502
+ "used",
3503
+ "expired"
3504
+ ]
3505
+ }
3506
+ }
3507
+ },
3508
+ "DeviceRecoveryApproval": {
3509
+ "type": "object",
3510
+ "required": [
3511
+ "match_number"
3512
+ ],
3513
+ "properties": {
3514
+ "match_number": {
3515
+ "type": "integer",
3516
+ "minimum": 10,
3517
+ "maximum": 99
3518
+ },
3519
+ "passkey": {
3520
+ "$ref": "#/$defs/PasskeyVerification"
3521
+ },
3522
+ "code": {
3523
+ "type": "string",
3524
+ "maxLength": 128
3525
+ },
3526
+ "password": {
3527
+ "type": "string",
3528
+ "maxLength": 1024,
3529
+ "deprecated": true,
3530
+ "description": "Ignored. Older clients still send it."
3531
+ }
3532
+ }
3533
+ },
3534
+ "DeviceRecoveryApprovalOptions": {
3535
+ "type": "object",
3536
+ "required": [
3537
+ "method"
3538
+ ],
3539
+ "properties": {
3540
+ "method": {
3541
+ "type": "string",
3542
+ "enum": [
3543
+ "passkey",
3544
+ "session"
1353
3545
  ]
1354
3546
  },
1355
- "reactions": {
1356
- "type": "array",
1357
- "items": {
1358
- "$ref": "#/$defs/Reaction"
1359
- }
3547
+ "challenge_id": {
3548
+ "type": "string",
3549
+ "minLength": 32,
3550
+ "maxLength": 128,
3551
+ "description": "Present with `method: passkey`."
1360
3552
  },
1361
- "read_by": {
1362
- "type": "array",
1363
- "items": {
1364
- "$ref": "#/$defs/ReadReceipt"
1365
- }
3553
+ "public_key": {
3554
+ "type": "object",
3555
+ "additionalProperties": true,
3556
+ "description": "WebAuthn request options, present with `method: passkey`."
1366
3557
  },
1367
- "created_at": {
3558
+ "approvable_from": {
3559
+ "type": "string",
3560
+ "format": "date-time",
3561
+ "description": "Present with `method: session` while the session is too new to approve."
3562
+ }
3563
+ }
3564
+ },
3565
+ "DeviceRecoveryComplete": {
3566
+ "type": "object",
3567
+ "required": [
3568
+ "new_password"
3569
+ ],
3570
+ "properties": {
3571
+ "new_password": {
3572
+ "type": "string",
3573
+ "minLength": 8,
3574
+ "maxLength": 128,
3575
+ "writeOnly": true
3576
+ }
3577
+ }
3578
+ },
3579
+ "QrLoginStatus": {
3580
+ "type": "string",
3581
+ "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",
3582
+ "enum": [
3583
+ "pending",
3584
+ "scanned",
3585
+ "approved",
3586
+ "denied",
3587
+ "expired"
3588
+ ]
3589
+ },
3590
+ "QrLoginStart": {
3591
+ "type": "object",
3592
+ "required": [
3593
+ "request_id",
3594
+ "poll_token",
3595
+ "url",
3596
+ "expires_at"
3597
+ ],
3598
+ "properties": {
3599
+ "request_id": {
3600
+ "type": "string",
3601
+ "minLength": 32,
3602
+ "maxLength": 128,
3603
+ "pattern": "^[A-Za-z0-9_-]+$"
3604
+ },
3605
+ "poll_token": {
3606
+ "type": "string",
3607
+ "minLength": 32,
3608
+ "maxLength": 128,
3609
+ "pattern": "^[A-Za-z0-9_-]+$",
3610
+ "description": "Secret of the requesting device; only a keyed hash is stored."
3611
+ },
3612
+ "url": {
3613
+ "type": "string",
3614
+ "description": "`<RECOVERY_WEB_URL>/qr/<request_id>`, the content of the QR code."
3615
+ },
3616
+ "expires_at": {
1368
3617
  "$ref": "#/$defs/Timestamp"
3618
+ }
3619
+ }
3620
+ },
3621
+ "QrLoginRequest": {
3622
+ "type": "object",
3623
+ "required": [
3624
+ "request_id",
3625
+ "status",
3626
+ "device",
3627
+ "location",
3628
+ "created_at",
3629
+ "expires_at"
3630
+ ],
3631
+ "properties": {
3632
+ "request_id": {
3633
+ "type": "string"
1369
3634
  },
1370
- "edited_at": {
3635
+ "status": {
3636
+ "$ref": "#/$defs/QrLoginStatus"
3637
+ },
3638
+ "device": {
3639
+ "type": [
3640
+ "string",
3641
+ "null"
3642
+ ],
3643
+ "maxLength": 512,
3644
+ "description": "User agent of the device that asks to sign in; `null` when it sent none."
3645
+ },
3646
+ "location": {
3647
+ "description": "Approximate location of the device that asks to sign in; `null` when unknown.",
1371
3648
  "oneOf": [
1372
3649
  {
1373
- "$ref": "#/$defs/Timestamp"
3650
+ "$ref": "#/$defs/Location"
1374
3651
  },
1375
3652
  {
1376
3653
  "type": "null"
1377
3654
  }
1378
3655
  ]
1379
3656
  },
1380
- "is_deleted": {
1381
- "type": "boolean"
3657
+ "created_at": {
3658
+ "$ref": "#/$defs/Timestamp"
1382
3659
  },
1383
- "client_temp_id": {
1384
- "$ref": "#/$defs/ClientTempId"
3660
+ "expires_at": {
3661
+ "$ref": "#/$defs/Timestamp"
1385
3662
  }
1386
3663
  }
1387
3664
  },
1388
- "MessagePage": {
3665
+ "QrLoginPollRequest": {
1389
3666
  "type": "object",
1390
3667
  "required": [
1391
- "items",
1392
- "next_cursor",
1393
- "prev_cursor"
3668
+ "poll_token"
1394
3669
  ],
1395
3670
  "properties": {
1396
- "items": {
1397
- "type": "array",
1398
- "description": "Oldest to newest",
1399
- "items": {
1400
- "$ref": "#/$defs/Message"
3671
+ "poll_token": {
3672
+ "type": "string",
3673
+ "maxLength": 128,
3674
+ "writeOnly": true
3675
+ }
3676
+ }
3677
+ },
3678
+ "QrLoginPollResult": {
3679
+ "oneOf": [
3680
+ {
3681
+ "type": "object",
3682
+ "required": [
3683
+ "status"
3684
+ ],
3685
+ "properties": {
3686
+ "status": {
3687
+ "type": "string",
3688
+ "enum": [
3689
+ "pending",
3690
+ "scanned",
3691
+ "denied",
3692
+ "expired"
3693
+ ]
3694
+ }
1401
3695
  }
1402
3696
  },
1403
- "next_cursor": {
1404
- "description": "Continues in the direction of the request: pass it as `before` (older) for the\ndefault, `before` and `around` requests, or as `after` (newer) for `after` requests.\n",
1405
- "oneOf": [
3697
+ {
3698
+ "allOf": [
1406
3699
  {
1407
- "$ref": "#/$defs/Id"
3700
+ "$ref": "#/$defs/TokenResponse"
1408
3701
  },
1409
3702
  {
1410
- "type": "null"
3703
+ "type": "object",
3704
+ "required": [
3705
+ "status"
3706
+ ],
3707
+ "properties": {
3708
+ "status": {
3709
+ "type": "string",
3710
+ "const": "approved"
3711
+ }
3712
+ }
1411
3713
  }
1412
3714
  ]
3715
+ }
3716
+ ]
3717
+ },
3718
+ "QrLoginApproval": {
3719
+ "type": "object",
3720
+ "properties": {
3721
+ "code": {
3722
+ "type": "string",
3723
+ "maxLength": 128,
3724
+ "description": "An authenticator code or an unused recovery code; required when two-factor is on."
3725
+ }
3726
+ }
3727
+ },
3728
+ "PasskeyOptions": {
3729
+ "type": "object",
3730
+ "required": [
3731
+ "challenge_id",
3732
+ "public_key"
3733
+ ],
3734
+ "properties": {
3735
+ "challenge_id": {
3736
+ "type": "string",
3737
+ "minLength": 32,
3738
+ "maxLength": 128
1413
3739
  },
1414
- "prev_cursor": {
1415
- "description": "The opposite direction (`after` for the default request, `before` for an `after` request).",
1416
- "oneOf": [
1417
- {
1418
- "$ref": "#/$defs/Id"
1419
- },
1420
- {
1421
- "type": "null"
1422
- }
1423
- ]
3740
+ "public_key": {
3741
+ "type": "object",
3742
+ "additionalProperties": true
3743
+ }
3744
+ }
3745
+ },
3746
+ "PasskeyRegistration": {
3747
+ "type": "object",
3748
+ "required": [
3749
+ "password",
3750
+ "name"
3751
+ ],
3752
+ "properties": {
3753
+ "password": {
3754
+ "type": "string",
3755
+ "maxLength": 128,
3756
+ "writeOnly": true
3757
+ },
3758
+ "code": {
3759
+ "type": "string",
3760
+ "maxLength": 128
3761
+ },
3762
+ "name": {
3763
+ "type": "string",
3764
+ "minLength": 1,
3765
+ "maxLength": 64
3766
+ }
3767
+ }
3768
+ },
3769
+ "PasskeyVerification": {
3770
+ "type": "object",
3771
+ "required": [
3772
+ "challenge_id",
3773
+ "credential"
3774
+ ],
3775
+ "properties": {
3776
+ "challenge_id": {
3777
+ "type": "string",
3778
+ "minLength": 32,
3779
+ "maxLength": 128
3780
+ },
3781
+ "credential": {
3782
+ "type": "object",
3783
+ "additionalProperties": true
3784
+ }
3785
+ }
3786
+ },
3787
+ "PasskeyLoginOptions": {
3788
+ "type": "object",
3789
+ "required": [],
3790
+ "properties": {
3791
+ "username": {
3792
+ "$ref": "#/$defs/Username"
3793
+ }
3794
+ }
3795
+ },
3796
+ "PasskeyRename": {
3797
+ "type": "object",
3798
+ "required": [
3799
+ "name"
3800
+ ],
3801
+ "properties": {
3802
+ "name": {
3803
+ "type": "string",
3804
+ "minLength": 1,
3805
+ "maxLength": 64
3806
+ }
3807
+ }
3808
+ },
3809
+ "PasskeyRemoval": {
3810
+ "type": "object",
3811
+ "required": [],
3812
+ "properties": {
3813
+ "password": {
3814
+ "type": "string",
3815
+ "maxLength": 128,
3816
+ "writeOnly": true
1424
3817
  }
1425
3818
  }
1426
3819
  },
1427
- "SearchHit": {
3820
+ "Passkey": {
1428
3821
  "type": "object",
1429
3822
  "required": [
1430
- "message"
3823
+ "id",
3824
+ "name",
3825
+ "created_at",
3826
+ "last_used_at"
1431
3827
  ],
1432
3828
  "properties": {
1433
- "message": {
1434
- "$ref": "#/$defs/Message"
3829
+ "id": {
3830
+ "type": "string"
1435
3831
  },
1436
- "highlight": {
3832
+ "name": {
3833
+ "type": "string",
3834
+ "minLength": 1,
3835
+ "maxLength": 64
3836
+ },
3837
+ "created_at": {
3838
+ "type": "string",
3839
+ "format": "date-time"
3840
+ },
3841
+ "last_used_at": {
1437
3842
  "type": [
1438
3843
  "string",
1439
3844
  "null"
1440
3845
  ],
1441
- "description": "Plain-text excerpt of the matching text or file name; never HTML. The matched words are\nwrapped in U+E000 (start) and U+E001 (end), characters of the Unicode private use area,\nso a client can mark them without parsing markup. `null` when the message matched without\nan excerpt.\n"
3846
+ "format": "date-time"
1442
3847
  }
1443
3848
  }
1444
3849
  },
1445
- "MessageSearchPage": {
3850
+ "PasskeyPage": {
1446
3851
  "type": "object",
1447
3852
  "required": [
1448
- "items",
1449
- "next_cursor"
3853
+ "items"
1450
3854
  ],
1451
3855
  "properties": {
1452
3856
  "items": {
1453
3857
  "type": "array",
1454
3858
  "items": {
1455
- "$ref": "#/$defs/SearchHit"
3859
+ "$ref": "#/$defs/Passkey"
1456
3860
  }
1457
- },
1458
- "next_cursor": {
1459
- "$ref": "#/$defs/Cursor"
1460
3861
  }
1461
3862
  }
1462
3863
  },
1463
- "SendMessageRequest": {
3864
+ "RecoveryEmailStatus": {
1464
3865
  "type": "object",
1465
3866
  "required": [
1466
- "client_temp_id",
1467
- "type"
3867
+ "address",
3868
+ "state",
3869
+ "enabled"
1468
3870
  ],
1469
3871
  "properties": {
1470
- "client_temp_id": {
1471
- "$ref": "#/$defs/ClientTempId"
3872
+ "address": {
3873
+ "type": "string"
1472
3874
  },
1473
- "type": {
3875
+ "state": {
1474
3876
  "type": "string",
1475
3877
  "enum": [
1476
- "text",
1477
- "file",
1478
- "voice"
3878
+ "not_added",
3879
+ "pending",
3880
+ "verified"
1479
3881
  ]
1480
3882
  },
1481
- "content": {
1482
- "type": [
1483
- "string",
1484
- "null"
1485
- ],
1486
- "maxLength": 4096
3883
+ "enabled": {
3884
+ "type": "boolean"
3885
+ }
3886
+ }
3887
+ },
3888
+ "RecoveryOverview": {
3889
+ "type": "object",
3890
+ "required": [
3891
+ "recovery_key",
3892
+ "other_devices",
3893
+ "passkeys",
3894
+ "passkeys_enabled",
3895
+ "email"
3896
+ ],
3897
+ "properties": {
3898
+ "recovery_key": {
3899
+ "$ref": "#/$defs/RecoveryKeyStatus"
1487
3900
  },
1488
- "attachment_id": {
1489
- "description": "Required and not null for `file` and `voice`; never a URL.",
1490
- "oneOf": [
1491
- {
1492
- "$ref": "#/$defs/AttachmentRef"
1493
- },
1494
- {
1495
- "type": "null"
1496
- }
1497
- ]
3901
+ "other_devices": {
3902
+ "type": "integer",
3903
+ "minimum": 0
1498
3904
  },
1499
- "reply_to": {
1500
- "oneOf": [
1501
- {
1502
- "$ref": "#/$defs/Id"
1503
- },
1504
- {
1505
- "type": "null"
1506
- }
1507
- ]
3905
+ "passkeys": {
3906
+ "type": "integer",
3907
+ "minimum": 0
3908
+ },
3909
+ "passkeys_enabled": {
3910
+ "type": "boolean"
3911
+ },
3912
+ "email": {
3913
+ "$ref": "#/$defs/RecoveryEmailStatus"
1508
3914
  }
1509
- },
1510
- "if": {
1511
- "properties": {
1512
- "type": {
1513
- "enum": [
1514
- "file",
1515
- "voice"
1516
- ]
1517
- }
3915
+ }
3916
+ },
3917
+ "SetRecoveryEmail": {
3918
+ "type": "object",
3919
+ "required": [
3920
+ "email",
3921
+ "password"
3922
+ ],
3923
+ "properties": {
3924
+ "email": {
3925
+ "type": "string",
3926
+ "format": "email",
3927
+ "maxLength": 254
3928
+ },
3929
+ "password": {
3930
+ "type": "string",
3931
+ "minLength": 8,
3932
+ "maxLength": 128,
3933
+ "writeOnly": true
3934
+ },
3935
+ "code": {
3936
+ "type": "string",
3937
+ "maxLength": 128
1518
3938
  }
1519
- },
1520
- "then": {
1521
- "required": [
1522
- "attachment_id"
1523
- ],
1524
- "properties": {
1525
- "attachment_id": {
1526
- "$ref": "#/$defs/AttachmentRef"
1527
- }
3939
+ }
3940
+ },
3941
+ "RemoveRecoveryEmail": {
3942
+ "type": "object",
3943
+ "required": [
3944
+ "password"
3945
+ ],
3946
+ "properties": {
3947
+ "password": {
3948
+ "type": "string",
3949
+ "minLength": 8,
3950
+ "maxLength": 128,
3951
+ "writeOnly": true
3952
+ },
3953
+ "code": {
3954
+ "type": "string",
3955
+ "maxLength": 128
1528
3956
  }
1529
- },
1530
- "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": {}
1542
- }
3957
+ }
3958
+ },
3959
+ "VerifyRecoveryEmail": {
3960
+ "type": "object",
3961
+ "required": [
3962
+ "token"
3963
+ ],
3964
+ "properties": {
3965
+ "token": {
3966
+ "type": "string",
3967
+ "minLength": 32,
3968
+ "maxLength": 128
1543
3969
  }
1544
3970
  }
1545
3971
  },
1546
- "EditMessageRequest": {
3972
+ "EmailResetRequest": {
1547
3973
  "type": "object",
1548
3974
  "required": [
1549
- "content"
3975
+ "username_or_email"
1550
3976
  ],
1551
3977
  "properties": {
1552
- "content": {
3978
+ "username_or_email": {
1553
3979
  "type": "string",
1554
- "minLength": 1,
1555
- "maxLength": 4096
3980
+ "maxLength": 254
1556
3981
  }
1557
3982
  }
1558
3983
  },
1559
- "ForwardMessageRequest": {
3984
+ "EmailResetConfirmation": {
1560
3985
  "type": "object",
1561
3986
  "required": [
1562
- "chat_ids"
3987
+ "token",
3988
+ "new_password"
1563
3989
  ],
1564
3990
  "properties": {
1565
- "chat_ids": {
1566
- "type": "array",
1567
- "minItems": 1,
1568
- "maxItems": 20,
1569
- "uniqueItems": true,
1570
- "items": {
1571
- "$ref": "#/$defs/Id"
1572
- }
3991
+ "token": {
3992
+ "type": "string",
3993
+ "minLength": 32,
3994
+ "maxLength": 128
3995
+ },
3996
+ "new_password": {
3997
+ "type": "string",
3998
+ "minLength": 8,
3999
+ "maxLength": 128,
4000
+ "writeOnly": true
4001
+ },
4002
+ "code": {
4003
+ "type": "string",
4004
+ "maxLength": 128
1573
4005
  }
1574
4006
  }
1575
4007
  },
1576
- "MarkReadRequest": {
4008
+ "EmailResetAccepted": {
1577
4009
  "type": "object",
1578
4010
  "required": [
1579
- "message_id"
4011
+ "message"
1580
4012
  ],
1581
4013
  "properties": {
1582
- "message_id": {
1583
- "description": "Everything up to and including this message is read.",
4014
+ "message": {
4015
+ "type": "string"
4016
+ }
4017
+ }
4018
+ },
4019
+ "CallConfig": {
4020
+ "type": "object",
4021
+ "required": [
4022
+ "enabled",
4023
+ "max_participants",
4024
+ "ring_timeout_seconds"
4025
+ ],
4026
+ "properties": {
4027
+ "enabled": {
4028
+ "type": "boolean"
4029
+ },
4030
+ "max_participants": {
4031
+ "type": "integer",
4032
+ "minimum": 2,
4033
+ "description": "Most sessions joined to one call at the same time."
4034
+ },
4035
+ "ring_timeout_seconds": {
4036
+ "type": "integer",
4037
+ "minimum": 1,
4038
+ "description": "How long an invitation rings before it counts as missed."
4039
+ }
4040
+ }
4041
+ },
4042
+ "CallIdentityRequest": {
4043
+ "type": "object",
4044
+ "required": [
4045
+ "public_key"
4046
+ ],
4047
+ "properties": {
4048
+ "public_key": {
4049
+ "$ref": "#/$defs/CallIdentityKey"
4050
+ }
4051
+ }
4052
+ },
4053
+ "CallIdentityKey": {
4054
+ "type": "string",
4055
+ "description": "P-256 public key as an uncompressed point (65 bytes, first byte `0x04`), base64url without padding.\n",
4056
+ "minLength": 87,
4057
+ "maxLength": 87,
4058
+ "pattern": "^[A-Za-z0-9_-]+$"
4059
+ },
4060
+ "CallState": {
4061
+ "type": "string",
4062
+ "description": "`ringing` until someone answers, `active` while people are in it, `ended` afterwards.",
4063
+ "enum": [
4064
+ "ringing",
4065
+ "active",
4066
+ "ended"
4067
+ ]
4068
+ },
4069
+ "CallEndReason": {
4070
+ "type": "string",
4071
+ "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",
4072
+ "enum": [
4073
+ "completed",
4074
+ "missed",
4075
+ "declined",
4076
+ "cancelled",
4077
+ "failed"
4078
+ ]
4079
+ },
4080
+ "CallParticipantState": {
4081
+ "type": "string",
4082
+ "description": "`left` and `declined` can become `joined` again in a group call.",
4083
+ "enum": [
4084
+ "ringing",
4085
+ "joined",
4086
+ "declined",
4087
+ "missed",
4088
+ "left"
4089
+ ]
4090
+ },
4091
+ "CallParticipant": {
4092
+ "type": "object",
4093
+ "required": [
4094
+ "user_id",
4095
+ "state",
4096
+ "session_id",
4097
+ "identity_key",
4098
+ "joined_at"
4099
+ ],
4100
+ "properties": {
4101
+ "user_id": {
1584
4102
  "$ref": "#/$defs/Id"
4103
+ },
4104
+ "state": {
4105
+ "$ref": "#/$defs/CallParticipantState"
4106
+ },
4107
+ "session_id": {
4108
+ "description": "The session that joined; `null` unless `state` is `joined`.",
4109
+ "oneOf": [
4110
+ {
4111
+ "type": "string",
4112
+ "format": "uuid"
4113
+ },
4114
+ {
4115
+ "type": "null"
4116
+ }
4117
+ ]
4118
+ },
4119
+ "identity_key": {
4120
+ "description": "Call identity of the joined session; `null` unless `state` is `joined`.",
4121
+ "oneOf": [
4122
+ {
4123
+ "$ref": "#/$defs/CallIdentityKey"
4124
+ },
4125
+ {
4126
+ "type": "null"
4127
+ }
4128
+ ]
4129
+ },
4130
+ "joined_at": {
4131
+ "description": "When the participant last joined; `null` if never.",
4132
+ "oneOf": [
4133
+ {
4134
+ "$ref": "#/$defs/Timestamp"
4135
+ },
4136
+ {
4137
+ "type": "null"
4138
+ }
4139
+ ]
1585
4140
  }
1586
4141
  }
1587
4142
  },
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
- ]
1602
- },
1603
- "Chat": {
4143
+ "Call": {
1604
4144
  "type": "object",
1605
4145
  "required": [
1606
4146
  "id",
1607
- "type",
1608
- "name",
1609
- "avatar_url",
1610
- "peer",
1611
- "is_pinned",
1612
- "unread_count",
1613
- "last_message",
1614
- "created_at"
4147
+ "chat_id",
4148
+ "kind",
4149
+ "state",
4150
+ "end_reason",
4151
+ "initiator_id",
4152
+ "created_at",
4153
+ "started_at",
4154
+ "ended_at",
4155
+ "ring_expires_at",
4156
+ "epoch",
4157
+ "version",
4158
+ "max_participants",
4159
+ "participants"
1615
4160
  ],
1616
4161
  "properties": {
1617
4162
  "id": {
1618
4163
  "$ref": "#/$defs/Id"
1619
4164
  },
1620
- "type": {
1621
- "$ref": "#/$defs/ChatType"
4165
+ "chat_id": {
4166
+ "$ref": "#/$defs/Id"
1622
4167
  },
1623
- "name": {
4168
+ "kind": {
1624
4169
  "type": "string",
1625
- "description": "Display name of the peer or the group"
1626
- },
1627
- "avatar_url": {
1628
- "type": [
1629
- "string",
1630
- "null"
4170
+ "enum": [
4171
+ "direct",
4172
+ "group"
1631
4173
  ]
1632
4174
  },
1633
- "peer": {
1634
- "description": "The other user of a direct chat; `null` for groups.",
4175
+ "state": {
4176
+ "$ref": "#/$defs/CallState"
4177
+ },
4178
+ "end_reason": {
1635
4179
  "oneOf": [
1636
4180
  {
1637
- "$ref": "#/$defs/User"
4181
+ "$ref": "#/$defs/CallEndReason"
1638
4182
  },
1639
4183
  {
1640
4184
  "type": "null"
1641
4185
  }
1642
4186
  ]
1643
4187
  },
1644
- "is_pinned": {
1645
- "type": "boolean"
4188
+ "initiator_id": {
4189
+ "$ref": "#/$defs/Id"
1646
4190
  },
1647
- "unread_count": {
1648
- "type": "integer",
1649
- "minimum": 0
4191
+ "created_at": {
4192
+ "$ref": "#/$defs/Timestamp"
1650
4193
  },
1651
- "last_message": {
4194
+ "started_at": {
4195
+ "description": "First answer; `null` while nobody answered.",
1652
4196
  "oneOf": [
1653
4197
  {
1654
- "$ref": "#/$defs/Message"
4198
+ "$ref": "#/$defs/Timestamp"
1655
4199
  },
1656
4200
  {
1657
4201
  "type": "null"
1658
4202
  }
1659
4203
  ]
1660
4204
  },
1661
- "my_role": {
1662
- "description": "Only for groups.",
4205
+ "ended_at": {
1663
4206
  "oneOf": [
1664
4207
  {
1665
- "$ref": "#/$defs/GroupRole"
4208
+ "$ref": "#/$defs/Timestamp"
1666
4209
  },
1667
4210
  {
1668
4211
  "type": "null"
1669
4212
  }
1670
4213
  ]
1671
4214
  },
1672
- "created_at": {
4215
+ "ring_expires_at": {
4216
+ "description": "When ringing invitations of this call turn into `missed`.",
1673
4217
  "$ref": "#/$defs/Timestamp"
4218
+ },
4219
+ "epoch": {
4220
+ "type": "integer",
4221
+ "minimum": 0,
4222
+ "description": "Key epoch; increases whenever the set of joined sessions or their identity keys change."
4223
+ },
4224
+ "version": {
4225
+ "type": "integer",
4226
+ "minimum": 1,
4227
+ "description": "Increases with every change of the call; ignore events with a lower version than one already seen."
4228
+ },
4229
+ "max_participants": {
4230
+ "type": "integer",
4231
+ "minimum": 2
4232
+ },
4233
+ "participants": {
4234
+ "type": "array",
4235
+ "description": "Everyone invited or joined, the initiator first.",
4236
+ "items": {
4237
+ "$ref": "#/$defs/CallParticipant"
4238
+ }
1674
4239
  }
1675
4240
  }
1676
4241
  },
1677
- "ChatPage": {
4242
+ "CallList": {
1678
4243
  "type": "object",
1679
4244
  "required": [
1680
- "items",
1681
- "next_cursor"
4245
+ "items"
1682
4246
  ],
1683
4247
  "properties": {
1684
4248
  "items": {
1685
4249
  "type": "array",
1686
4250
  "items": {
1687
- "$ref": "#/$defs/Chat"
4251
+ "$ref": "#/$defs/Call"
1688
4252
  }
1689
- },
1690
- "next_cursor": {
1691
- "$ref": "#/$defs/Cursor"
1692
4253
  }
1693
4254
  }
1694
4255
  },
1695
- "CreateChatRequest": {
4256
+ "StartCallRequest": {
1696
4257
  "type": "object",
1697
4258
  "required": [
1698
- "user_id"
4259
+ "client_request_id"
1699
4260
  ],
1700
4261
  "properties": {
1701
- "user_id": {
1702
- "$ref": "#/$defs/Id"
1703
- },
1704
- "initial_message": {
1705
- "type": [
1706
- "string",
1707
- "null"
1708
- ],
1709
- "maxLength": 4096
4262
+ "client_request_id": {
4263
+ "type": "string",
4264
+ "format": "uuid",
4265
+ "description": "Idempotency key chosen by the client."
1710
4266
  }
1711
4267
  }
1712
4268
  },
1713
- "GroupMember": {
4269
+ "JoinCallRequest": {
1714
4270
  "type": "object",
1715
- "required": [
1716
- "user",
1717
- "role",
1718
- "joined_at"
1719
- ],
1720
4271
  "properties": {
1721
- "user": {
1722
- "$ref": "#/$defs/User"
1723
- },
1724
- "role": {
1725
- "$ref": "#/$defs/GroupRole"
1726
- },
1727
- "joined_at": {
1728
- "$ref": "#/$defs/Timestamp"
4272
+ "takeover": {
4273
+ "type": "boolean",
4274
+ "default": false,
4275
+ "description": "Move the user's participation from another session to this one."
1729
4276
  }
1730
4277
  }
1731
4278
  },
1732
- "Group": {
4279
+ "CallGrant": {
1733
4280
  "type": "object",
1734
4281
  "required": [
1735
- "id",
1736
- "name",
1737
- "description",
1738
- "avatar_url",
1739
- "owner_id",
1740
- "my_role",
1741
- "members",
1742
- "created_at"
4282
+ "url",
4283
+ "token",
4284
+ "identity",
4285
+ "expires_at"
1743
4286
  ],
1744
4287
  "properties": {
1745
- "id": {
1746
- "$ref": "#/$defs/Id"
1747
- },
1748
- "name": {
4288
+ "url": {
1749
4289
  "type": "string",
1750
- "minLength": 1,
1751
- "maxLength": 64
1752
- },
1753
- "description": {
1754
- "type": [
1755
- "string",
1756
- "null"
1757
- ],
1758
- "maxLength": 500
1759
- },
1760
- "avatar_url": {
1761
- "type": [
1762
- "string",
1763
- "null"
1764
- ]
1765
- },
1766
- "owner_id": {
1767
- "$ref": "#/$defs/Id"
4290
+ "description": "WebSocket URL of the media server (`wss://`)."
1768
4291
  },
1769
- "my_role": {
1770
- "$ref": "#/$defs/GroupRole"
4292
+ "token": {
4293
+ "type": "string",
4294
+ "description": "Media access token for this call and session only; microphone audio only."
1771
4295
  },
1772
- "members": {
1773
- "type": "array",
1774
- "items": {
1775
- "$ref": "#/$defs/GroupMember"
1776
- }
4296
+ "identity": {
4297
+ "type": "string",
4298
+ "description": "The participant identity inside the media room (`<user_id>:<session_id>`)."
1777
4299
  },
1778
- "created_at": {
4300
+ "expires_at": {
1779
4301
  "$ref": "#/$defs/Timestamp"
1780
4302
  }
1781
4303
  }
1782
4304
  },
1783
- "CreateGroupRequest": {
4305
+ "CallJoin": {
1784
4306
  "type": "object",
1785
4307
  "required": [
1786
- "name",
1787
- "member_ids"
4308
+ "call",
4309
+ "grant"
1788
4310
  ],
1789
4311
  "properties": {
1790
- "name": {
1791
- "type": "string",
1792
- "minLength": 1,
1793
- "maxLength": 64
1794
- },
1795
- "description": {
1796
- "type": [
1797
- "string",
1798
- "null"
1799
- ],
1800
- "maxLength": 500
4312
+ "call": {
4313
+ "$ref": "#/$defs/Call"
1801
4314
  },
1802
- "member_ids": {
1803
- "type": "array",
1804
- "maxItems": 200,
1805
- "uniqueItems": true,
1806
- "items": {
1807
- "$ref": "#/$defs/Id"
1808
- }
4315
+ "grant": {
4316
+ "$ref": "#/$defs/CallGrant"
1809
4317
  }
1810
4318
  }
1811
4319
  },
1812
- "UpdateGroupRequest": {
4320
+ "CallKeyEnvelope": {
1813
4321
  "type": "object",
1814
- "minProperties": 1,
4322
+ "description": "An HPKE Auth-mode envelope carrying one sender key (see `docs/calls-e2ee.md`).",
4323
+ "required": [
4324
+ "epoch",
4325
+ "sender_user_id",
4326
+ "sender_session_id",
4327
+ "recipient_session_id",
4328
+ "enc",
4329
+ "ciphertext"
4330
+ ],
1815
4331
  "properties": {
1816
- "name": {
4332
+ "epoch": {
4333
+ "type": "integer",
4334
+ "minimum": 0
4335
+ },
4336
+ "sender_user_id": {
4337
+ "$ref": "#/$defs/Id"
4338
+ },
4339
+ "sender_session_id": {
1817
4340
  "type": "string",
1818
- "minLength": 1,
1819
- "maxLength": 64
4341
+ "format": "uuid"
1820
4342
  },
1821
- "description": {
1822
- "type": [
1823
- "string",
1824
- "null"
1825
- ],
1826
- "maxLength": 500
4343
+ "recipient_session_id": {
4344
+ "type": "string",
4345
+ "format": "uuid"
4346
+ },
4347
+ "enc": {
4348
+ "type": "string",
4349
+ "description": "HPKE encapsulated key, base64url without padding.",
4350
+ "maxLength": 128,
4351
+ "pattern": "^[A-Za-z0-9_-]+$"
4352
+ },
4353
+ "ciphertext": {
4354
+ "type": "string",
4355
+ "description": "Sealed sender key, base64url without padding.",
4356
+ "maxLength": 256,
4357
+ "pattern": "^[A-Za-z0-9_-]+$"
1827
4358
  }
1828
4359
  }
1829
4360
  },
1830
- "AddParticipantRequest": {
4361
+ "CallKeyEnvelopeList": {
1831
4362
  "type": "object",
1832
4363
  "required": [
1833
- "user_id"
4364
+ "call_id",
4365
+ "epoch",
4366
+ "items"
1834
4367
  ],
1835
4368
  "properties": {
1836
- "user_id": {
4369
+ "call_id": {
1837
4370
  "$ref": "#/$defs/Id"
4371
+ },
4372
+ "epoch": {
4373
+ "type": "integer",
4374
+ "minimum": 0
4375
+ },
4376
+ "items": {
4377
+ "type": "array",
4378
+ "items": {
4379
+ "$ref": "#/$defs/CallKeyEnvelope"
4380
+ }
1838
4381
  }
1839
4382
  }
1840
4383
  },
1841
- "UpdateRoleRequest": {
4384
+ "SendCallKeysRequest": {
1842
4385
  "type": "object",
1843
4386
  "required": [
1844
- "role"
4387
+ "epoch",
4388
+ "envelopes"
1845
4389
  ],
1846
4390
  "properties": {
1847
- "role": {
1848
- "type": "string",
1849
- "enum": [
1850
- "admin",
1851
- "member"
1852
- ]
4391
+ "epoch": {
4392
+ "type": "integer",
4393
+ "minimum": 0
4394
+ },
4395
+ "envelopes": {
4396
+ "type": "array",
4397
+ "minItems": 1,
4398
+ "maxItems": 64,
4399
+ "items": {
4400
+ "$ref": "#/$defs/OutgoingCallKeyEnvelope"
4401
+ }
1853
4402
  }
1854
4403
  }
1855
4404
  },
1856
- "TransferOwnerRequest": {
4405
+ "OutgoingCallKeyEnvelope": {
1857
4406
  "type": "object",
1858
4407
  "required": [
1859
- "user_id"
4408
+ "recipient_session_id",
4409
+ "enc",
4410
+ "ciphertext"
1860
4411
  ],
1861
4412
  "properties": {
1862
- "user_id": {
1863
- "$ref": "#/$defs/Id"
4413
+ "recipient_session_id": {
4414
+ "type": "string",
4415
+ "format": "uuid"
4416
+ },
4417
+ "enc": {
4418
+ "type": "string",
4419
+ "maxLength": 128,
4420
+ "pattern": "^[A-Za-z0-9_-]+$"
4421
+ },
4422
+ "ciphertext": {
4423
+ "type": "string",
4424
+ "maxLength": 256,
4425
+ "pattern": "^[A-Za-z0-9_-]+$"
1864
4426
  }
1865
4427
  }
1866
4428
  },
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": {
4429
+ "CallSummary": {
1883
4430
  "type": "object",
4431
+ "description": "The call a `call` system message records.",
1884
4432
  "required": [
1885
- "id",
1886
- "type",
1887
- "status",
1888
- "requester",
1889
- "created_at"
4433
+ "call_id",
4434
+ "kind",
4435
+ "outcome",
4436
+ "duration_seconds"
1890
4437
  ],
1891
4438
  "properties": {
1892
- "id": {
4439
+ "call_id": {
1893
4440
  "$ref": "#/$defs/Id"
1894
4441
  },
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`"
4442
+ "kind": {
4443
+ "type": "string",
4444
+ "enum": [
4445
+ "direct",
4446
+ "group"
4447
+ ]
1910
4448
  },
1911
- "preview": {
1912
- "type": [
1913
- "string",
1914
- "null"
1915
- ],
1916
- "description": "First message of a direct-message request"
4449
+ "outcome": {
4450
+ "$ref": "#/$defs/CallEndReason"
1917
4451
  },
1918
- "created_at": {
1919
- "$ref": "#/$defs/Timestamp"
4452
+ "duration_seconds": {
4453
+ "description": "From the first answer to the end; `null` if nobody answered.",
4454
+ "oneOf": [
4455
+ {
4456
+ "type": "integer",
4457
+ "minimum": 0
4458
+ },
4459
+ {
4460
+ "type": "null"
4461
+ }
4462
+ ]
1920
4463
  }
1921
4464
  }
1922
4465
  },
@@ -1965,7 +4508,7 @@
1965
4508
  },
1966
4509
  "ClientEditEvent": {
1967
4510
  "title": "ClientEditEvent",
1968
- "description": "Edit your own text message.",
4511
+ "description": "Edit your own text message or the caption of your file. An empty content removes a file's caption.",
1969
4512
  "type": "object",
1970
4513
  "properties": {
1971
4514
  "type": {
@@ -1985,7 +4528,6 @@
1985
4528
  },
1986
4529
  "content": {
1987
4530
  "type": "string",
1988
- "minLength": 1,
1989
4531
  "maxLength": 4096
1990
4532
  }
1991
4533
  },
@@ -2253,7 +4795,7 @@
2253
4795
  },
2254
4796
  "ClientTypingEvent": {
2255
4797
  "title": "ClientTypingEvent",
2256
- "description": "Tell the chat that you are (not) typing. Not acknowledged, so it carries no `client_temp_id`.",
4798
+ "description": "Tell the chat that you are (not) typing, recording a voice message, choosing a sticker or sending a photo, video or file. 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
4799
  "type": "object",
2258
4800
  "properties": {
2259
4801
  "type": {
@@ -2267,6 +4809,19 @@
2267
4809
  "properties": {
2268
4810
  "is_typing": {
2269
4811
  "type": "boolean"
4812
+ },
4813
+ "action": {
4814
+ "description": "What you are doing. Without it, `typing`.",
4815
+ "type": "string",
4816
+ "enum": [
4817
+ "typing",
4818
+ "recording_voice",
4819
+ "choosing_sticker",
4820
+ "uploading_photo",
4821
+ "uploading_video",
4822
+ "uploading_file"
4823
+ ],
4824
+ "default": "typing"
2270
4825
  }
2271
4826
  },
2272
4827
  "required": [
@@ -2381,6 +4936,64 @@
2381
4936
  "data"
2382
4937
  ]
2383
4938
  },
4939
+ "ServerCallKeysEvent": {
4940
+ "title": "ServerCallKeysEvent",
4941
+ "description": "Sealed sender keys for this session (see docs/calls-e2ee.md). Sent only to the recipient session.",
4942
+ "type": "object",
4943
+ "properties": {
4944
+ "type": {
4945
+ "const": "call_keys"
4946
+ },
4947
+ "event_id": {
4948
+ "$ref": "#/$defs/Id"
4949
+ },
4950
+ "chat_id": {
4951
+ "$ref": "#/$defs/Id"
4952
+ },
4953
+ "data": {
4954
+ "$ref": "#/$defs/CallKeyEnvelopeList"
4955
+ }
4956
+ },
4957
+ "required": [
4958
+ "type",
4959
+ "event_id",
4960
+ "chat_id",
4961
+ "data"
4962
+ ]
4963
+ },
4964
+ "ServerCallUpdatedEvent": {
4965
+ "title": "ServerCallUpdatedEvent",
4966
+ "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.",
4967
+ "type": "object",
4968
+ "properties": {
4969
+ "type": {
4970
+ "const": "call_updated"
4971
+ },
4972
+ "event_id": {
4973
+ "$ref": "#/$defs/Id"
4974
+ },
4975
+ "chat_id": {
4976
+ "$ref": "#/$defs/Id"
4977
+ },
4978
+ "data": {
4979
+ "type": "object",
4980
+ "properties": {
4981
+ "call": {
4982
+ "$ref": "#/$defs/Call"
4983
+ }
4984
+ },
4985
+ "required": [
4986
+ "call"
4987
+ ]
4988
+ }
4989
+ },
4990
+ "required": [
4991
+ "type",
4992
+ "event_id",
4993
+ "chat_id",
4994
+ "data"
4995
+ ]
4996
+ },
2384
4997
  "ServerChatCreatedEvent": {
2385
4998
  "title": "ServerChatCreatedEvent",
2386
4999
  "description": "A chat was created with you.",
@@ -2701,6 +5314,51 @@
2701
5314
  "data"
2702
5315
  ]
2703
5316
  },
5317
+ "ServerHistoryClearedEvent": {
5318
+ "title": "ServerHistoryClearedEvent",
5319
+ "description": "Messages of the chat up to before_message_id were cleared, for you (scope me) or for every member (scope everyone). Drop them from what you show.",
5320
+ "type": "object",
5321
+ "properties": {
5322
+ "type": {
5323
+ "const": "history_cleared"
5324
+ },
5325
+ "event_id": {
5326
+ "$ref": "#/$defs/Id"
5327
+ },
5328
+ "chat_id": {
5329
+ "$ref": "#/$defs/Id"
5330
+ },
5331
+ "data": {
5332
+ "type": "object",
5333
+ "properties": {
5334
+ "before_message_id": {
5335
+ "$ref": "#/$defs/Id"
5336
+ },
5337
+ "scope": {
5338
+ "type": "string",
5339
+ "enum": [
5340
+ "me",
5341
+ "everyone"
5342
+ ]
5343
+ },
5344
+ "actor_id": {
5345
+ "$ref": "#/$defs/Id"
5346
+ }
5347
+ },
5348
+ "required": [
5349
+ "before_message_id",
5350
+ "scope",
5351
+ "actor_id"
5352
+ ]
5353
+ }
5354
+ },
5355
+ "required": [
5356
+ "type",
5357
+ "event_id",
5358
+ "chat_id",
5359
+ "data"
5360
+ ]
5361
+ },
2704
5362
  "ServerMessageEvent": {
2705
5363
  "title": "ServerMessageEvent",
2706
5364
  "description": "A new message in a chat.",
@@ -2897,6 +5555,136 @@
2897
5555
  "data"
2898
5556
  ]
2899
5557
  },
5558
+ "ServerRecoveryRequestEvent": {
5559
+ "title": "ServerRecoveryRequestEvent",
5560
+ "type": "object",
5561
+ "required": [
5562
+ "type",
5563
+ "event_id",
5564
+ "chat_id",
5565
+ "data"
5566
+ ],
5567
+ "additionalProperties": false,
5568
+ "properties": {
5569
+ "type": {
5570
+ "const": "recovery_request"
5571
+ },
5572
+ "event_id": {
5573
+ "type": "string",
5574
+ "pattern": "^[0-9]+$"
5575
+ },
5576
+ "chat_id": {
5577
+ "type": "null"
5578
+ },
5579
+ "data": {
5580
+ "type": "object",
5581
+ "required": [
5582
+ "request_id",
5583
+ "user_agent",
5584
+ "location",
5585
+ "choices",
5586
+ "expires_at"
5587
+ ],
5588
+ "properties": {
5589
+ "request_id": {
5590
+ "description": "Approval handle for POST /auth/recovery-requests/{requestId}/approve and /deny. It is not the requester's capability.",
5591
+ "type": "string",
5592
+ "minLength": 32,
5593
+ "maxLength": 128,
5594
+ "pattern": "^[A-Za-z0-9_-]+$"
5595
+ },
5596
+ "user_agent": {
5597
+ "type": "string"
5598
+ },
5599
+ "location": {
5600
+ "oneOf": [
5601
+ {
5602
+ "$ref": "#/$defs/Location"
5603
+ },
5604
+ {
5605
+ "type": "null"
5606
+ }
5607
+ ]
5608
+ },
5609
+ "choices": {
5610
+ "type": "array",
5611
+ "minItems": 3,
5612
+ "maxItems": 3,
5613
+ "uniqueItems": true,
5614
+ "items": {
5615
+ "type": "integer",
5616
+ "minimum": 10,
5617
+ "maximum": 99
5618
+ }
5619
+ },
5620
+ "expires_at": {
5621
+ "type": "string",
5622
+ "format": "date-time"
5623
+ }
5624
+ }
5625
+ }
5626
+ }
5627
+ },
5628
+ "ServerSecurityAlertEvent": {
5629
+ "title": "ServerSecurityAlertEvent",
5630
+ "type": "object",
5631
+ "required": [
5632
+ "type",
5633
+ "event_id",
5634
+ "chat_id",
5635
+ "data"
5636
+ ],
5637
+ "properties": {
5638
+ "type": {
5639
+ "const": "security_alert"
5640
+ },
5641
+ "event_id": {
5642
+ "$ref": "#/$defs/Id"
5643
+ },
5644
+ "chat_id": {
5645
+ "type": "null"
5646
+ },
5647
+ "data": {
5648
+ "type": "object",
5649
+ "required": [
5650
+ "type"
5651
+ ],
5652
+ "properties": {
5653
+ "type": {
5654
+ "type": "string",
5655
+ "enum": [
5656
+ "password_changed",
5657
+ "recovery_key_changed",
5658
+ "2fa_enabled",
5659
+ "2fa_disabled",
5660
+ "passkey_added",
5661
+ "passkey_removed",
5662
+ "recovery_email_changed",
5663
+ "recovery_email_removed",
5664
+ "passkey_counter_warning",
5665
+ "login",
5666
+ "login_2fa",
5667
+ "passkey_login",
5668
+ "qr_login_approved"
5669
+ ]
5670
+ },
5671
+ "user_agent": {
5672
+ "type": "string",
5673
+ "maxLength": 512
5674
+ },
5675
+ "created_at": {
5676
+ "type": "string",
5677
+ "format": "date-time"
5678
+ },
5679
+ "session_id": {
5680
+ "description": "The session that made the change, when a signed-in session made it. Clients skip alerts for their own session.",
5681
+ "type": "string",
5682
+ "format": "uuid"
5683
+ }
5684
+ }
5685
+ }
5686
+ }
5687
+ },
2900
5688
  "ServerSecurityNoticeEvent": {
2901
5689
  "title": "ServerSecurityNoticeEvent",
2902
5690
  "type": "object",
@@ -2931,7 +5719,7 @@
2931
5719
  },
2932
5720
  "ServerTypingEvent": {
2933
5721
  "title": "ServerTypingEvent",
2934
- "description": "A user started or stopped typing.",
5722
+ "description": "A user started or stopped typing, recording a voice message, choosing a sticker or sending a photo, video or file. Hide it after about 6 seconds without a repeat: the sender may disconnect before it sends `false`.",
2935
5723
  "type": "object",
2936
5724
  "properties": {
2937
5725
  "type": {
@@ -2951,11 +5739,62 @@
2951
5739
  },
2952
5740
  "is_typing": {
2953
5741
  "type": "boolean"
5742
+ },
5743
+ "action": {
5744
+ "description": "What the user is doing. New values may be added: show an unknown one like `typing`.",
5745
+ "type": "string",
5746
+ "enum": [
5747
+ "typing",
5748
+ "recording_voice",
5749
+ "choosing_sticker",
5750
+ "uploading_photo",
5751
+ "uploading_video",
5752
+ "uploading_file"
5753
+ ]
2954
5754
  }
2955
5755
  },
2956
5756
  "required": [
2957
5757
  "user_id",
2958
- "is_typing"
5758
+ "is_typing",
5759
+ "action"
5760
+ ]
5761
+ }
5762
+ },
5763
+ "required": [
5764
+ "type",
5765
+ "event_id",
5766
+ "chat_id",
5767
+ "data"
5768
+ ]
5769
+ },
5770
+ "ServerUserUpdatedEvent": {
5771
+ "title": "ServerUserUpdatedEvent",
5772
+ "description": "A user you share a chat with changed their username, display name, bio, avatar, pronouns, birthday, profile music or profile background. Fetch GET /users/{user_id} again when profile_version is higher than the one you keep.",
5773
+ "type": "object",
5774
+ "properties": {
5775
+ "type": {
5776
+ "const": "user_updated"
5777
+ },
5778
+ "event_id": {
5779
+ "$ref": "#/$defs/Id"
5780
+ },
5781
+ "chat_id": {
5782
+ "type": "null"
5783
+ },
5784
+ "data": {
5785
+ "type": "object",
5786
+ "properties": {
5787
+ "user_id": {
5788
+ "$ref": "#/$defs/Id"
5789
+ },
5790
+ "profile_version": {
5791
+ "type": "integer",
5792
+ "minimum": 0
5793
+ }
5794
+ },
5795
+ "required": [
5796
+ "user_id",
5797
+ "profile_version"
2959
5798
  ]
2960
5799
  }
2961
5800
  },
@@ -3006,6 +5845,12 @@
3006
5845
  {
3007
5846
  "$ref": "#/$defs/ServerApprovalRequestCreatedEvent"
3008
5847
  },
5848
+ {
5849
+ "$ref": "#/$defs/ServerCallKeysEvent"
5850
+ },
5851
+ {
5852
+ "$ref": "#/$defs/ServerCallUpdatedEvent"
5853
+ },
3009
5854
  {
3010
5855
  "$ref": "#/$defs/ServerChatCreatedEvent"
3011
5856
  },
@@ -3033,6 +5878,9 @@
3033
5878
  {
3034
5879
  "$ref": "#/$defs/ServerHelloEvent"
3035
5880
  },
5881
+ {
5882
+ "$ref": "#/$defs/ServerHistoryClearedEvent"
5883
+ },
3036
5884
  {
3037
5885
  "$ref": "#/$defs/ServerMessageEvent"
3038
5886
  },
@@ -3048,11 +5896,20 @@
3048
5896
  {
3049
5897
  "$ref": "#/$defs/ServerReadEvent"
3050
5898
  },
5899
+ {
5900
+ "$ref": "#/$defs/ServerRecoveryRequestEvent"
5901
+ },
5902
+ {
5903
+ "$ref": "#/$defs/ServerSecurityAlertEvent"
5904
+ },
3051
5905
  {
3052
5906
  "$ref": "#/$defs/ServerSecurityNoticeEvent"
3053
5907
  },
3054
5908
  {
3055
5909
  "$ref": "#/$defs/ServerTypingEvent"
5910
+ },
5911
+ {
5912
+ "$ref": "#/$defs/ServerUserUpdatedEvent"
3056
5913
  }
3057
5914
  ]
3058
5915
  }