@myronsi/messenger-api 2.1.0-alpha.40 → 2.1.0-alpha.41

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.
package/dist/openapi.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  openapi: 3.1.0
2
2
  info:
3
3
  title: Messenger API
4
- version: 2.1.0-alpha.40
4
+ version: 2.1.0-alpha.41
5
5
  summary: REST contract of the Messenger backend (v2).
6
6
  description: |
7
7
  Contract for the Go backend. The WebSocket protocol is described in `websocket/` and
@@ -64,6 +64,8 @@ tags:
64
64
  description: Realtime connection (see `websocket.md`)
65
65
  - name: calls
66
66
  description: Audio calls (see `docs/calls.md` and `docs/calls-e2ee.md`)
67
+ - name: public
68
+ description: Profile and group cards for people without an account, and link previews (see `docs/sharing.md`)
67
69
 
68
70
  paths:
69
71
  /meta:
@@ -2678,6 +2680,9 @@ paths:
2678
2680
  tags: [groups]
2679
2681
  operationId: removeGroupParticipant
2680
2682
  summary: Remove a participant
2683
+ description: |
2684
+ The removed user is also banned from the group (`GET /groups/{chat_id}/bans`): they cannot rejoin by invite
2685
+ link or public name and cannot be added again until an admin lifts the ban.
2681
2686
  responses:
2682
2687
  "426": { $ref: "#/components/responses/ClientOutdated" }
2683
2688
  "400": { $ref: "#/components/responses/BadRequest" }
@@ -2791,6 +2796,491 @@ paths:
2791
2796
  schema: { $ref: "#/components/schemas/GroupRoleLog" }
2792
2797
  "401": { $ref: "#/components/responses/Unauthorized" }
2793
2798
  "404": { $ref: "#/components/responses/NotFound" }
2799
+ /groups/{chat_id}/invite-links:
2800
+ parameters:
2801
+ - $ref: "#/components/parameters/ClientVersion"
2802
+ - $ref: "#/components/parameters/ClientApiVersion"
2803
+ - $ref: "#/components/parameters/ChatId"
2804
+ get:
2805
+ tags: [groups]
2806
+ operationId: listGroupInviteLinks
2807
+ summary: Invite links of the group
2808
+ description: Owner and admins only (`403` for other members). Newest first, revoked and expired links included.
2809
+ responses:
2810
+ "426": { $ref: "#/components/responses/ClientOutdated" }
2811
+ "400": { $ref: "#/components/responses/BadRequest" }
2812
+ "200":
2813
+ description: The links
2814
+ content:
2815
+ application/json:
2816
+ schema: { $ref: "#/components/schemas/InviteLinkList" }
2817
+ "401": { $ref: "#/components/responses/Unauthorized" }
2818
+ "403": { $ref: "#/components/responses/Forbidden" }
2819
+ "404": { $ref: "#/components/responses/NotFound" }
2820
+ post:
2821
+ tags: [groups]
2822
+ operationId: createGroupInviteLink
2823
+ summary: Create an invite link
2824
+ description: |
2825
+ Owner and admins only. Anyone with the link joins the group directly, unless banned from it. At most 50
2826
+ active links per group (`409` `limit_reached`). Accounts at `limited` or above get `403`
2827
+ `account_restricted` (`share_group`).
2828
+ requestBody:
2829
+ required: true
2830
+ content:
2831
+ application/json:
2832
+ schema: { $ref: "#/components/schemas/CreateInviteLinkRequest" }
2833
+ responses:
2834
+ "426": { $ref: "#/components/responses/ClientOutdated" }
2835
+ "400": { $ref: "#/components/responses/BadRequest" }
2836
+ "201":
2837
+ description: The new link
2838
+ content:
2839
+ application/json:
2840
+ schema: { $ref: "#/components/schemas/InviteLink" }
2841
+ "401": { $ref: "#/components/responses/Unauthorized" }
2842
+ "403": { $ref: "#/components/responses/Forbidden" }
2843
+ "404": { $ref: "#/components/responses/NotFound" }
2844
+ "409": { $ref: "#/components/responses/Conflict" }
2845
+ "422": { $ref: "#/components/responses/ValidationFailed" }
2846
+ "429": { $ref: "#/components/responses/TooManyRequests" }
2847
+ /groups/{chat_id}/invite-links/{link_id}:
2848
+ parameters:
2849
+ - $ref: "#/components/parameters/ClientVersion"
2850
+ - $ref: "#/components/parameters/ClientApiVersion"
2851
+ - $ref: "#/components/parameters/ChatId"
2852
+ - $ref: "#/components/parameters/InviteLinkId"
2853
+ patch:
2854
+ tags: [groups]
2855
+ operationId: updateGroupInviteLink
2856
+ summary: Rename an invite link or change its expiry or use limit
2857
+ description: Owner and admins only. A revoked link cannot be changed (`409`).
2858
+ requestBody:
2859
+ required: true
2860
+ content:
2861
+ application/json:
2862
+ schema: { $ref: "#/components/schemas/UpdateInviteLinkRequest" }
2863
+ responses:
2864
+ "426": { $ref: "#/components/responses/ClientOutdated" }
2865
+ "400": { $ref: "#/components/responses/BadRequest" }
2866
+ "200":
2867
+ description: The updated link
2868
+ content:
2869
+ application/json:
2870
+ schema: { $ref: "#/components/schemas/InviteLink" }
2871
+ "401": { $ref: "#/components/responses/Unauthorized" }
2872
+ "403": { $ref: "#/components/responses/Forbidden" }
2873
+ "404": { $ref: "#/components/responses/NotFound" }
2874
+ "409": { $ref: "#/components/responses/Conflict" }
2875
+ "422": { $ref: "#/components/responses/ValidationFailed" }
2876
+ delete:
2877
+ tags: [groups]
2878
+ operationId: revokeGroupInviteLink
2879
+ summary: Revoke an invite link
2880
+ description: Owner and admins only. The link stops working at once; it stays in the list as revoked. Idempotent.
2881
+ responses:
2882
+ "426": { $ref: "#/components/responses/ClientOutdated" }
2883
+ "400": { $ref: "#/components/responses/BadRequest" }
2884
+ "204":
2885
+ description: Revoked
2886
+ "401": { $ref: "#/components/responses/Unauthorized" }
2887
+ "403": { $ref: "#/components/responses/Forbidden" }
2888
+ "404": { $ref: "#/components/responses/NotFound" }
2889
+ /groups/{chat_id}/public-name:
2890
+ parameters:
2891
+ - $ref: "#/components/parameters/ClientVersion"
2892
+ - $ref: "#/components/parameters/ClientApiVersion"
2893
+ - $ref: "#/components/parameters/ChatId"
2894
+ put:
2895
+ tags: [groups]
2896
+ operationId: setGroupPublicName
2897
+ summary: Make the group public under a name, or change that name
2898
+ description: |
2899
+ Owner and admins only. A public group can be found in `GET /public-groups` and joined by anyone through
2900
+ `/@name`, unless banned. The name shares one name space with usernames, ignoring case: a name in use is
2901
+ `409` `already_exists`, a reserved name `422`. The old name is free at once. Accounts at `limited` or above
2902
+ get `403` `account_restricted` (`share_group`).
2903
+ requestBody:
2904
+ required: true
2905
+ content:
2906
+ application/json:
2907
+ schema: { $ref: "#/components/schemas/SetPublicNameRequest" }
2908
+ responses:
2909
+ "426": { $ref: "#/components/responses/ClientOutdated" }
2910
+ "400": { $ref: "#/components/responses/BadRequest" }
2911
+ "200":
2912
+ description: Updated group
2913
+ content:
2914
+ application/json:
2915
+ schema: { $ref: "#/components/schemas/Group" }
2916
+ "401": { $ref: "#/components/responses/Unauthorized" }
2917
+ "403": { $ref: "#/components/responses/Forbidden" }
2918
+ "404": { $ref: "#/components/responses/NotFound" }
2919
+ "409": { $ref: "#/components/responses/Conflict" }
2920
+ "422": { $ref: "#/components/responses/ValidationFailed" }
2921
+ "429": { $ref: "#/components/responses/TooManyRequests" }
2922
+ delete:
2923
+ tags: [groups]
2924
+ operationId: clearGroupPublicName
2925
+ summary: Make the group private again
2926
+ description: Owner and admins only. The name is free at once; members and invite links stay. Idempotent.
2927
+ responses:
2928
+ "426": { $ref: "#/components/responses/ClientOutdated" }
2929
+ "400": { $ref: "#/components/responses/BadRequest" }
2930
+ "200":
2931
+ description: Updated group
2932
+ content:
2933
+ application/json:
2934
+ schema: { $ref: "#/components/schemas/Group" }
2935
+ "401": { $ref: "#/components/responses/Unauthorized" }
2936
+ "403": { $ref: "#/components/responses/Forbidden" }
2937
+ "404": { $ref: "#/components/responses/NotFound" }
2938
+ /groups/{chat_id}/bans:
2939
+ parameters:
2940
+ - $ref: "#/components/parameters/ClientVersion"
2941
+ - $ref: "#/components/parameters/ClientApiVersion"
2942
+ - $ref: "#/components/parameters/ChatId"
2943
+ get:
2944
+ tags: [groups]
2945
+ operationId: listGroupBans
2946
+ summary: Users banned from the group
2947
+ description: |
2948
+ Owner and admins only. Removing a member (`DELETE /groups/{chat_id}/participants/{user_id}`) bans them: they
2949
+ cannot rejoin by invite link or public name and cannot be added again until an admin lifts the ban. Leaving
2950
+ the group yourself does not ban. Newest first.
2951
+ parameters:
2952
+ - $ref: "#/components/parameters/Limit"
2953
+ - $ref: "#/components/parameters/After"
2954
+ responses:
2955
+ "426": { $ref: "#/components/responses/ClientOutdated" }
2956
+ "400": { $ref: "#/components/responses/BadRequest" }
2957
+ "200":
2958
+ description: A page of bans
2959
+ content:
2960
+ application/json:
2961
+ schema: { $ref: "#/components/schemas/GroupBanPage" }
2962
+ "401": { $ref: "#/components/responses/Unauthorized" }
2963
+ "403": { $ref: "#/components/responses/Forbidden" }
2964
+ "404": { $ref: "#/components/responses/NotFound" }
2965
+ /groups/{chat_id}/bans/{user_id}:
2966
+ parameters:
2967
+ - $ref: "#/components/parameters/ClientVersion"
2968
+ - $ref: "#/components/parameters/ClientApiVersion"
2969
+ - $ref: "#/components/parameters/ChatId"
2970
+ - $ref: "#/components/parameters/UserId"
2971
+ delete:
2972
+ tags: [groups]
2973
+ operationId: unbanGroupUser
2974
+ summary: Lift a ban
2975
+ description: Owner and admins only. The user is not added back; they can join again by link or be added. Idempotent.
2976
+ responses:
2977
+ "426": { $ref: "#/components/responses/ClientOutdated" }
2978
+ "400": { $ref: "#/components/responses/BadRequest" }
2979
+ "204":
2980
+ description: Lifted
2981
+ "401": { $ref: "#/components/responses/Unauthorized" }
2982
+ "403": { $ref: "#/components/responses/Forbidden" }
2983
+ "404": { $ref: "#/components/responses/NotFound" }
2984
+ /invites/{token}:
2985
+ parameters:
2986
+ - $ref: "#/components/parameters/ClientVersion"
2987
+ - $ref: "#/components/parameters/ClientApiVersion"
2988
+ - $ref: "#/components/parameters/InviteToken"
2989
+ get:
2990
+ tags: [groups]
2991
+ operationId: getInvite
2992
+ summary: The group behind an invite link
2993
+ description: |
2994
+ `404` when the token is unknown, revoked, expired or used up. `chat_id` is set when the caller is already a
2995
+ member. Rate limited per user.
2996
+ responses:
2997
+ "426": { $ref: "#/components/responses/ClientOutdated" }
2998
+ "400": { $ref: "#/components/responses/BadRequest" }
2999
+ "200":
3000
+ description: The group
3001
+ content:
3002
+ application/json:
3003
+ schema: { $ref: "#/components/schemas/GroupPreview" }
3004
+ "401": { $ref: "#/components/responses/Unauthorized" }
3005
+ "404": { $ref: "#/components/responses/NotFound" }
3006
+ "429": { $ref: "#/components/responses/TooManyRequests" }
3007
+ /invites/{token}/join:
3008
+ parameters:
3009
+ - $ref: "#/components/parameters/ClientVersion"
3010
+ - $ref: "#/components/parameters/ClientApiVersion"
3011
+ - $ref: "#/components/parameters/InviteToken"
3012
+ post:
3013
+ tags: [groups]
3014
+ operationId: joinByInvite
3015
+ summary: Join a group through an invite link
3016
+ description: |
3017
+ Joins directly and posts a `member_joined` system message. A member gets the chat back without a change.
3018
+ `404` for an unknown, revoked, expired or used-up link; `403` `forbidden` when banned from the group; `403`
3019
+ `account_restricted` (`join_by_link`) at `restricted` or above. At most 20 joins by link or public name per
3020
+ hour (`429`).
3021
+ responses:
3022
+ "426": { $ref: "#/components/responses/ClientOutdated" }
3023
+ "400": { $ref: "#/components/responses/BadRequest" }
3024
+ "200":
3025
+ description: The group chat
3026
+ content:
3027
+ application/json:
3028
+ schema: { $ref: "#/components/schemas/Chat" }
3029
+ "401": { $ref: "#/components/responses/Unauthorized" }
3030
+ "403": { $ref: "#/components/responses/Forbidden" }
3031
+ "404": { $ref: "#/components/responses/NotFound" }
3032
+ "429": { $ref: "#/components/responses/TooManyRequests" }
3033
+ /public-groups:
3034
+ parameters:
3035
+ - $ref: "#/components/parameters/ClientVersion"
3036
+ - $ref: "#/components/parameters/ClientApiVersion"
3037
+ get:
3038
+ tags: [groups]
3039
+ operationId: searchPublicGroups
3040
+ summary: Search public groups by public name or group name
3041
+ parameters:
3042
+ - name: q
3043
+ in: query
3044
+ required: true
3045
+ schema: { type: string, minLength: 2, maxLength: 64 }
3046
+ - $ref: "#/components/parameters/Limit"
3047
+ - $ref: "#/components/parameters/After"
3048
+ responses:
3049
+ "426": { $ref: "#/components/responses/ClientOutdated" }
3050
+ "400": { $ref: "#/components/responses/BadRequest" }
3051
+ "200":
3052
+ description: A page of public groups
3053
+ content:
3054
+ application/json:
3055
+ schema: { $ref: "#/components/schemas/GroupPreviewPage" }
3056
+ "401": { $ref: "#/components/responses/Unauthorized" }
3057
+ "422": { $ref: "#/components/responses/ValidationFailed" }
3058
+ /public-groups/{public_name}:
3059
+ parameters:
3060
+ - $ref: "#/components/parameters/ClientVersion"
3061
+ - $ref: "#/components/parameters/ClientApiVersion"
3062
+ - $ref: "#/components/parameters/PublicNameParam"
3063
+ get:
3064
+ tags: [groups]
3065
+ operationId: getPublicGroup
3066
+ summary: A public group by its public name
3067
+ description: "`chat_id` is set when the caller is a member. Rate limited per user."
3068
+ responses:
3069
+ "426": { $ref: "#/components/responses/ClientOutdated" }
3070
+ "400": { $ref: "#/components/responses/BadRequest" }
3071
+ "200":
3072
+ description: The group
3073
+ content:
3074
+ application/json:
3075
+ schema: { $ref: "#/components/schemas/GroupPreview" }
3076
+ "401": { $ref: "#/components/responses/Unauthorized" }
3077
+ "404": { $ref: "#/components/responses/NotFound" }
3078
+ "429": { $ref: "#/components/responses/TooManyRequests" }
3079
+ /public-groups/{public_name}/join:
3080
+ parameters:
3081
+ - $ref: "#/components/parameters/ClientVersion"
3082
+ - $ref: "#/components/parameters/ClientApiVersion"
3083
+ - $ref: "#/components/parameters/PublicNameParam"
3084
+ post:
3085
+ tags: [groups]
3086
+ operationId: joinPublicGroup
3087
+ summary: Join a public group
3088
+ description: The same rules as `POST /invites/{token}/join`.
3089
+ responses:
3090
+ "426": { $ref: "#/components/responses/ClientOutdated" }
3091
+ "400": { $ref: "#/components/responses/BadRequest" }
3092
+ "200":
3093
+ description: The group chat
3094
+ content:
3095
+ application/json:
3096
+ schema: { $ref: "#/components/schemas/Chat" }
3097
+ "401": { $ref: "#/components/responses/Unauthorized" }
3098
+ "403": { $ref: "#/components/responses/Forbidden" }
3099
+ "404": { $ref: "#/components/responses/NotFound" }
3100
+ "429": { $ref: "#/components/responses/TooManyRequests" }
3101
+ /public-names/{public_name}/availability:
3102
+ parameters:
3103
+ - $ref: "#/components/parameters/ClientVersion"
3104
+ - $ref: "#/components/parameters/ClientApiVersion"
3105
+ - $ref: "#/components/parameters/PublicNameParam"
3106
+ get:
3107
+ tags: [groups]
3108
+ operationId: getPublicNameAvailability
3109
+ summary: Whether a public name is free for a group
3110
+ description: Rate limited per user.
3111
+ responses:
3112
+ "426": { $ref: "#/components/responses/ClientOutdated" }
3113
+ "400": { $ref: "#/components/responses/BadRequest" }
3114
+ "200":
3115
+ description: Availability
3116
+ content:
3117
+ application/json:
3118
+ schema: { $ref: "#/components/schemas/PublicNameAvailability" }
3119
+ "401": { $ref: "#/components/responses/Unauthorized" }
3120
+ "429": { $ref: "#/components/responses/TooManyRequests" }
3121
+ /chats/{chat_id}/mentions:
3122
+ parameters:
3123
+ - $ref: "#/components/parameters/ClientVersion"
3124
+ - $ref: "#/components/parameters/ClientApiVersion"
3125
+ - $ref: "#/components/parameters/ChatId"
3126
+ get:
3127
+ tags: [chats]
3128
+ operationId: listUnreadMentions
3129
+ summary: The caller's unread mentions in a chat
3130
+ description: |
3131
+ IDs of the messages that mention the caller (by `@username`, or `@all` from an owner or admin) and are newer
3132
+ than the caller's read marker, oldest first, at most 100. `Chat.unread_mentions_count` counts them; reading
3133
+ past a message removes it.
3134
+ responses:
3135
+ "426": { $ref: "#/components/responses/ClientOutdated" }
3136
+ "400": { $ref: "#/components/responses/BadRequest" }
3137
+ "200":
3138
+ description: Unread mentions
3139
+ content:
3140
+ application/json:
3141
+ schema: { $ref: "#/components/schemas/MentionList" }
3142
+ "401": { $ref: "#/components/responses/Unauthorized" }
3143
+ "404": { $ref: "#/components/responses/NotFound" }
3144
+
3145
+ # -------------------------------------------------------------- public
3146
+ /public/names/{public_name}:
3147
+ parameters:
3148
+ - $ref: "#/components/parameters/PublicNameParam"
3149
+ get:
3150
+ tags: [public]
3151
+ operationId: getPublicName
3152
+ summary: What a public link `/@name` shows to someone without an account
3153
+ description: |
3154
+ No authentication. A user is `user` only when their `web_profile_visibility` is `everyone`, their
3155
+ `search_visibility` is `everyone` and their account is not `restricted` or `suspended`; a group is `group` only
3156
+ when it has this public name. Everything else, including unknown names, is `unavailable`, so the answer does
3157
+ not tell whether a name exists. Rate limited per IP. `X-Robots-Tag: noindex`.
3158
+ security: []
3159
+ responses:
3160
+ "200":
3161
+ description: The public card
3162
+ content:
3163
+ application/json:
3164
+ schema: { $ref: "#/components/schemas/PublicNameLookup" }
3165
+ "400": { $ref: "#/components/responses/BadRequest" }
3166
+ "429": { $ref: "#/components/responses/TooManyRequests" }
3167
+ /public/invites/{token}:
3168
+ parameters:
3169
+ - $ref: "#/components/parameters/InviteToken"
3170
+ get:
3171
+ tags: [public]
3172
+ operationId: getPublicInvite
3173
+ summary: What an invite link shows to someone without an account
3174
+ description: |
3175
+ No authentication. `404` when the token is unknown, revoked, expired or used up. Rate limited per IP.
3176
+ `X-Robots-Tag: noindex`.
3177
+ security: []
3178
+ responses:
3179
+ "200":
3180
+ description: The group card
3181
+ content:
3182
+ application/json:
3183
+ schema: { $ref: "#/components/schemas/PublicGroup" }
3184
+ "400": { $ref: "#/components/responses/BadRequest" }
3185
+ "404": { $ref: "#/components/responses/NotFound" }
3186
+ "429": { $ref: "#/components/responses/TooManyRequests" }
3187
+ /public/names/{public_name}/avatar:
3188
+ parameters:
3189
+ - $ref: "#/components/parameters/PublicNameParam"
3190
+ get:
3191
+ tags: [public]
3192
+ operationId: getPublicNameAvatar
3193
+ summary: Avatar of a public user or group
3194
+ description: |
3195
+ No authentication. For a user: only while `GET /public/names/{public_name}` shows them and their
3196
+ `avatar_visibility` is `everyone`. For a public group: its avatar. `404` otherwise (no default image).
3197
+ `avatar_url` in `PublicUser` and `PublicGroup` carries `rev`; while it matches, the answer may be cached for
3198
+ a day. Rate limited per IP.
3199
+ security: []
3200
+ parameters:
3201
+ - name: rev
3202
+ in: query
3203
+ schema: { type: string, maxLength: 64 }
3204
+ - name: size
3205
+ in: query
3206
+ description: As in `GET /users/{user_id}/avatar`.
3207
+ schema: { type: integer, minimum: 1, maximum: 4096 }
3208
+ responses:
3209
+ "200":
3210
+ description: Image
3211
+ content:
3212
+ image/*:
3213
+ schema: { type: string, format: binary }
3214
+ "304":
3215
+ description: Not modified (`If-None-Match` with the `ETag` of an earlier answer)
3216
+ "400": { $ref: "#/components/responses/BadRequest" }
3217
+ "404": { $ref: "#/components/responses/NotFound" }
3218
+ "429": { $ref: "#/components/responses/TooManyRequests" }
3219
+ /public/invites/{token}/avatar:
3220
+ parameters:
3221
+ - $ref: "#/components/parameters/InviteToken"
3222
+ get:
3223
+ tags: [public]
3224
+ operationId: getPublicInviteAvatar
3225
+ summary: Avatar of the group behind an invite link
3226
+ description: No authentication. `404` when the link does not work or the group has no avatar. Rate limited per IP.
3227
+ security: []
3228
+ parameters:
3229
+ - name: rev
3230
+ in: query
3231
+ schema: { type: string, maxLength: 64 }
3232
+ - name: size
3233
+ in: query
3234
+ schema: { type: integer, minimum: 1, maximum: 4096 }
3235
+ responses:
3236
+ "200":
3237
+ description: Image
3238
+ content:
3239
+ image/*:
3240
+ schema: { type: string, format: binary }
3241
+ "304":
3242
+ description: Not modified (`If-None-Match` with the `ETag` of an earlier answer)
3243
+ "400": { $ref: "#/components/responses/BadRequest" }
3244
+ "404": { $ref: "#/components/responses/NotFound" }
3245
+ "429": { $ref: "#/components/responses/TooManyRequests" }
3246
+ /og/names/{public_name}:
3247
+ parameters:
3248
+ - $ref: "#/components/parameters/PublicNameParam"
3249
+ get:
3250
+ tags: [public]
3251
+ operationId: getOpenGraphName
3252
+ summary: Link preview page for `/@name`, for crawlers
3253
+ description: |
3254
+ No authentication. A small HTML page with Open Graph and Twitter tags (`og:title`, `og:description`,
3255
+ `og:image`, `og:url`) built from the same card as `GET /public/names/{public_name}`, and
3256
+ `<meta name="robots" content="noindex">`. The web server sends link-preview crawlers of other apps here;
3257
+ people get the web app. An unavailable name gets a generic Messenger card. Rate limited per IP.
3258
+ security: []
3259
+ responses:
3260
+ "200":
3261
+ description: HTML page
3262
+ content:
3263
+ text/html:
3264
+ schema: { type: string }
3265
+ "400": { $ref: "#/components/responses/BadRequest" }
3266
+ "429": { $ref: "#/components/responses/TooManyRequests" }
3267
+ /og/invites/{token}:
3268
+ parameters:
3269
+ - $ref: "#/components/parameters/InviteToken"
3270
+ get:
3271
+ tags: [public]
3272
+ operationId: getOpenGraphInvite
3273
+ summary: Link preview page for `/join/{token}`, for crawlers
3274
+ description: Like `GET /og/names/{public_name}`, for an invite link. A link that does not work gets a generic card.
3275
+ security: []
3276
+ responses:
3277
+ "200":
3278
+ description: HTML page
3279
+ content:
3280
+ text/html:
3281
+ schema: { type: string }
3282
+ "400": { $ref: "#/components/responses/BadRequest" }
3283
+ "429": { $ref: "#/components/responses/TooManyRequests" }
2794
3284
  /stickers/packs:
2795
3285
  parameters:
2796
3286
  - $ref: "#/components/parameters/ClientVersion"
@@ -5429,6 +5919,21 @@ components:
5429
5919
  in: path
5430
5920
  required: true
5431
5921
  schema: { $ref: "#/components/schemas/Id" }
5922
+ InviteLinkId:
5923
+ name: link_id
5924
+ in: path
5925
+ required: true
5926
+ schema: { $ref: "#/components/schemas/Id" }
5927
+ InviteToken:
5928
+ name: token
5929
+ in: path
5930
+ required: true
5931
+ schema: { $ref: "#/components/schemas/InviteToken" }
5932
+ PublicNameParam:
5933
+ name: public_name
5934
+ in: path
5935
+ required: true
5936
+ schema: { $ref: "#/components/schemas/PublicName" }
5432
5937
  ReportOutcomeId:
5433
5938
  name: outcome_id
5434
5939
  in: path
@@ -5596,6 +6101,11 @@ components:
5596
6101
  description: |
5597
6102
  A push at 09:00 (in `Me.time_zone`) when someone you have a direct chat with has a birthday. Always sent
5598
6103
  by the server; when a `PUT` leaves it out, it stays as it is. Defaults to `true`.
6104
+ mentions_in_muted:
6105
+ type: boolean
6106
+ description: |
6107
+ A push when someone mentions you (`@username`, or `@all` from an owner or admin) in a chat you muted.
6108
+ Always sent by the server; when a `PUT` leaves it out, it stays as it is. Defaults to `true`.
5599
6109
  NotificationSettings:
5600
6110
  type: object
5601
6111
  required:
@@ -6159,6 +6669,7 @@ components:
6159
6669
  - typing_indicators_enabled
6160
6670
  - voice_video_messages
6161
6671
  - forward_link
6672
+ - web_profile_visibility
6162
6673
  - exceptions
6163
6674
  properties:
6164
6675
  avatar_visibility: { $ref: "#/components/schemas/Visibility" }
@@ -6199,6 +6710,7 @@ components:
6199
6710
  Who sees `ForwardedFrom.sender_id` when this user's messages are forwarded. Others get `null`; the name
6200
6711
  stays.
6201
6712
  allOf: [{ $ref: "#/components/schemas/ForwardLinkPolicy" }]
6713
+ web_profile_visibility: { $ref: "#/components/schemas/WebProfileVisibility" }
6202
6714
  exceptions: { $ref: "#/components/schemas/PrivacyExceptions" }
6203
6715
  UpdatePrivacySettingsRequest:
6204
6716
  type: object
@@ -6221,6 +6733,7 @@ components:
6221
6733
  typing_indicators_enabled: { type: boolean }
6222
6734
  voice_video_messages: { $ref: "#/components/schemas/VoiceVideoPolicy" }
6223
6735
  forward_link: { $ref: "#/components/schemas/ForwardLinkPolicy" }
6736
+ web_profile_visibility: { $ref: "#/components/schemas/WebProfileVisibility" }
6224
6737
  PrivacyExceptionsRequest:
6225
6738
  type: object
6226
6739
  required: [user_ids]
@@ -6346,7 +6859,7 @@ components:
6346
6859
  AccountRestriction:
6347
6860
  type: string
6348
6861
  description: An action the account status blocks. Unknown values must be shown as a generic restriction.
6349
- enum: [start_direct, invite_to_group, call, create_group, upload, forward, edit_profile, publish_pack, search, send, manage_group]
6862
+ enum: [start_direct, invite_to_group, call, create_group, upload, forward, edit_profile, publish_pack, search, send, manage_group, share_group, join_by_link]
6350
6863
  AccountStatus:
6351
6864
  type: object
6352
6865
  required: [status, since, restrictions, can_appeal, probation_until, review_requested_at, can_request_review]
@@ -7131,6 +7644,17 @@ components:
7131
7644
  system_event:
7132
7645
  $ref: "#/components/schemas/SystemEvent"
7133
7646
  client_temp_id: { $ref: "#/components/schemas/ClientTempId" }
7647
+ mentions:
7648
+ type: array
7649
+ description: |
7650
+ Group members the text mentions by `@username` (ignoring case), found by the server when the message was
7651
+ sent or last edited; at most 20. Absent when there are none and in direct chats. Clients render every
7652
+ `@name` token as a link to `/@name`; these IDs only decide highlighting and notifications.
7653
+ maxItems: 20
7654
+ items: { $ref: "#/components/schemas/Id" }
7655
+ mentions_all:
7656
+ type: boolean
7657
+ description: "`true` when an owner or admin wrote `@all`; it mentions every member. Absent otherwise."
7134
7658
  LinkPreview:
7135
7659
  type: object
7136
7660
  required: [url, title, description, site_name, image]
@@ -7412,6 +7936,7 @@ components:
7412
7936
  - is_archived
7413
7937
  - is_request
7414
7938
  - unread_count
7939
+ - unread_mentions_count
7415
7940
  - first_unread_message_id
7416
7941
  - last_read_message_id
7417
7942
  - last_message
@@ -7441,6 +7966,12 @@ components:
7441
7966
  Whether the chat is in the caller's Requests folder: a stranger opened it, and the caller has not
7442
7967
  replied, accepted, pinned or archived it yet (only for the caller).
7443
7968
  unread_count: { type: integer, minimum: 0 }
7969
+ unread_mentions_count:
7970
+ type: integer
7971
+ minimum: 0
7972
+ description: |
7973
+ Unread messages that mention the caller (`GET /chats/{chat_id}/mentions`). Clients show an `@` badge while
7974
+ it is above 0. Always 0 in direct chats.
7444
7975
  first_unread_message_id:
7445
7976
  description: |
7446
7977
  The oldest message the caller has not read (the same messages `unread_count` counts: not their own,
@@ -7535,7 +8066,7 @@ components:
7535
8066
  joined_at: { $ref: "#/components/schemas/Timestamp" }
7536
8067
  Group:
7537
8068
  type: object
7538
- required: [id, name, description, avatar_url, background, owner_id, my_role, members, created_at]
8069
+ required: [id, name, description, avatar_url, background, owner_id, my_role, members, created_at, public_name]
7539
8070
  properties:
7540
8071
  id: { $ref: "#/components/schemas/Id" }
7541
8072
  name: { type: string, minLength: 1, maxLength: 64 }
@@ -7552,6 +8083,11 @@ components:
7552
8083
  type: array
7553
8084
  items: { $ref: "#/components/schemas/GroupMember" }
7554
8085
  created_at: { $ref: "#/components/schemas/Timestamp" }
8086
+ public_name:
8087
+ description: The group's public name (`/@name`); `null` for a private group.
8088
+ oneOf:
8089
+ - $ref: "#/components/schemas/PublicName"
8090
+ - type: "null"
7555
8091
  CreateGroupRequest:
7556
8092
  type: object
7557
8093
  required: [name, member_ids]
@@ -7588,6 +8124,197 @@ components:
7588
8124
  user_id: { $ref: "#/components/schemas/Id" }
7589
8125
 
7590
8126
  # -------------------------------------------------------- requests
8127
+ PublicName:
8128
+ type: string
8129
+ description: |
8130
+ A username or a group's public name. One name space for both, unique ignoring case; links are `/@name` on the
8131
+ web app's origin.
8132
+ pattern: "^[A-Za-z0-9_]{3,32}$"
8133
+ InviteToken:
8134
+ type: string
8135
+ description: The secret part of an invite link `/join/{token}`.
8136
+ pattern: "^[A-Za-z0-9]{22}$"
8137
+ WebProfileVisibility:
8138
+ type: string
8139
+ description: |
8140
+ Whether people without an account (and link previews in other apps) see the profile card at `/@username`:
8141
+ display name, username, and the avatar and bio when `avatar_visibility` and `profile_visibility` are
8142
+ `everyone`. Defaults to `everyone`.
8143
+ enum: [everyone, nobody]
8144
+ PublicUser:
8145
+ type: object
8146
+ description: The card of a user for someone without an account. Never carries an ID, presence or other fields.
8147
+ required: [username, display_name, avatar_url, bio]
8148
+ properties:
8149
+ username: { $ref: "#/components/schemas/Username" }
8150
+ display_name: { type: string }
8151
+ avatar_url:
8152
+ description: "`/api/v2/public/names/{username}/avatar?rev=…`; `null` when hidden or unset."
8153
+ type: [string, "null"]
8154
+ bio:
8155
+ description: "`null` when `profile_visibility` is not `everyone` or the bio is empty."
8156
+ type: [string, "null"]
8157
+ PublicGroup:
8158
+ type: object
8159
+ description: The card of a group for someone without an account. No members and no messages.
8160
+ required: [name, public_name, description, avatar_url, member_count]
8161
+ properties:
8162
+ name: { type: string }
8163
+ public_name:
8164
+ description: Set for a public group.
8165
+ oneOf:
8166
+ - $ref: "#/components/schemas/PublicName"
8167
+ - type: "null"
8168
+ description: { type: [string, "null"] }
8169
+ avatar_url:
8170
+ description: "A public avatar URL (`/api/v2/public/names/…/avatar` or `/api/v2/public/invites/…/avatar`), or `null`."
8171
+ type: [string, "null"]
8172
+ member_count: { type: integer, minimum: 0 }
8173
+ PublicNameKind:
8174
+ type: string
8175
+ description: Unknown values must be treated like `unavailable`.
8176
+ enum: [user, group, unavailable]
8177
+ PublicNameLookup:
8178
+ type: object
8179
+ required: [kind]
8180
+ properties:
8181
+ kind: { $ref: "#/components/schemas/PublicNameKind" }
8182
+ user:
8183
+ description: Set when `kind` is `user`.
8184
+ $ref: "#/components/schemas/PublicUser"
8185
+ group:
8186
+ description: Set when `kind` is `group`.
8187
+ $ref: "#/components/schemas/PublicGroup"
8188
+ GroupPreview:
8189
+ type: object
8190
+ description: A group the caller may join, as seen before joining.
8191
+ required: [group, chat_id]
8192
+ properties:
8193
+ group: { $ref: "#/components/schemas/PublicGroup" }
8194
+ chat_id:
8195
+ description: The chat when the caller is already a member; `null` otherwise.
8196
+ oneOf:
8197
+ - $ref: "#/components/schemas/Id"
8198
+ - type: "null"
8199
+ GroupPreviewPage:
8200
+ type: object
8201
+ required: [items, next_cursor]
8202
+ properties:
8203
+ items:
8204
+ type: array
8205
+ items: { $ref: "#/components/schemas/GroupPreview" }
8206
+ next_cursor: { $ref: "#/components/schemas/Cursor" }
8207
+ PublicNameAvailability:
8208
+ type: object
8209
+ required: [public_name, available]
8210
+ properties:
8211
+ public_name: { $ref: "#/components/schemas/PublicName" }
8212
+ available:
8213
+ type: boolean
8214
+ description: "`false` when a user or another group has the name (ignoring case) or it is reserved."
8215
+ InviteLink:
8216
+ type: object
8217
+ required: [id, token, name, created_by, created_at, expires_at, max_uses, use_count, revoked_at, is_active]
8218
+ properties:
8219
+ id: { $ref: "#/components/schemas/Id" }
8220
+ token: { $ref: "#/components/schemas/InviteToken" }
8221
+ name:
8222
+ type: [string, "null"]
8223
+ maxLength: 64
8224
+ created_by:
8225
+ description: The user who created the link; `null` after that account was deleted.
8226
+ oneOf:
8227
+ - $ref: "#/components/schemas/Id"
8228
+ - type: "null"
8229
+ created_at: { $ref: "#/components/schemas/Timestamp" }
8230
+ expires_at:
8231
+ description: "`null`: never expires."
8232
+ oneOf:
8233
+ - $ref: "#/components/schemas/Timestamp"
8234
+ - type: "null"
8235
+ max_uses:
8236
+ description: "`null`: no limit."
8237
+ type: [integer, "null"]
8238
+ minimum: 1
8239
+ maximum: 100000
8240
+ use_count: { type: integer, minimum: 0 }
8241
+ revoked_at:
8242
+ oneOf:
8243
+ - $ref: "#/components/schemas/Timestamp"
8244
+ - type: "null"
8245
+ is_active:
8246
+ type: boolean
8247
+ description: Not revoked, not expired and not used up.
8248
+ InviteLinkList:
8249
+ type: object
8250
+ required: [items]
8251
+ properties:
8252
+ items:
8253
+ type: array
8254
+ items: { $ref: "#/components/schemas/InviteLink" }
8255
+ CreateInviteLinkRequest:
8256
+ type: object
8257
+ properties:
8258
+ name:
8259
+ type: [string, "null"]
8260
+ maxLength: 64
8261
+ expires_at:
8262
+ description: In the future, at most 366 days ahead; `null` or absent for a link that never expires.
8263
+ oneOf:
8264
+ - $ref: "#/components/schemas/Timestamp"
8265
+ - type: "null"
8266
+ max_uses:
8267
+ description: "`null` or absent for no limit."
8268
+ type: [integer, "null"]
8269
+ minimum: 1
8270
+ maximum: 100000
8271
+ UpdateInviteLinkRequest:
8272
+ type: object
8273
+ minProperties: 1
8274
+ description: Fields left out stay as they are; `null` clears the expiry or the limit.
8275
+ properties:
8276
+ name:
8277
+ type: [string, "null"]
8278
+ maxLength: 64
8279
+ expires_at:
8280
+ oneOf:
8281
+ - $ref: "#/components/schemas/Timestamp"
8282
+ - type: "null"
8283
+ max_uses:
8284
+ type: [integer, "null"]
8285
+ minimum: 1
8286
+ maximum: 100000
8287
+ SetPublicNameRequest:
8288
+ type: object
8289
+ required: [public_name]
8290
+ properties:
8291
+ public_name: { $ref: "#/components/schemas/PublicName" }
8292
+ GroupBan:
8293
+ type: object
8294
+ required: [user, banned_by, created_at]
8295
+ properties:
8296
+ user: { $ref: "#/components/schemas/User" }
8297
+ banned_by:
8298
+ oneOf:
8299
+ - $ref: "#/components/schemas/Id"
8300
+ - type: "null"
8301
+ created_at: { $ref: "#/components/schemas/Timestamp" }
8302
+ GroupBanPage:
8303
+ type: object
8304
+ required: [items, next_cursor]
8305
+ properties:
8306
+ items:
8307
+ type: array
8308
+ items: { $ref: "#/components/schemas/GroupBan" }
8309
+ next_cursor: { $ref: "#/components/schemas/Cursor" }
8310
+ MentionList:
8311
+ type: object
8312
+ required: [message_ids]
8313
+ properties:
8314
+ message_ids:
8315
+ type: array
8316
+ maxItems: 100
8317
+ items: { $ref: "#/components/schemas/Id" }
7591
8318
  ApprovalRequestType:
7592
8319
  type: string
7593
8320
  enum: [direct_message, group_invite]