Breaking Changes in Lemmy 1.0
The major breaking changes for version 1.0 are already implemented. However it will still take a lot of work to implement the new features in lemmy-ui, and publish the final release. So this is a good time for developers of Lemmy clients to start adapting the new API, and suggest changes before it gets finalized.
If you use any apps, frontends or bots for Lemmy, please help us out by notifying the developers about this post.
With the new version there is all new documentation based on OpenAPI, thanks to @dessalines and @MV-GH. You can also test the new API on voyager.lemmy.ml, and with Lemmy version 1.0.0-alpha.0
. Note that this server still uses lemmy-ui 0.19.8 with API v3, because lemmy-ui is not updated for the new backend version yet.
Unfortunately there is no good way to see all the API changes between 0.19 and 1.0, but you can try viewing the diff in lemmy-js-client, or see the pull requests listed below.
If you have any questions about these changes, feel free to post in !lemmy_support@lemmy.ml or in the Development Chat on Matrix. If you have suggestions for breaking API changes before the new version is finalized, open an issue.
Here are the major API changes in detail. As this is an alpha version there may be further breaking changes before the final release, but nothing major.
Rename account endpoints
Various endpoints have been renamed, especially those under /api/v3/user
have been moved to /api/v4/account/auth
. These changes are fully compatible as the endpoints can still be called under /api/v3
.
/api/v3/user/register
to/api/v4/account/auth/register
/api/v3/user/login
to/api/v4/account/auth/login
/api/v3/user/logout
to/api/v4/account/auth/logout
- …
/api/v4/site
doesn’t havemy_user
anymore, this is now available atGET /api/v4/account
https://github.com/LemmyNet/lemmy/pull/5216
Combined endpoints
There are various places in the UI where different types of data are shown together, for example posts and comments in the user profile. Until 0.19
these were queried separately, to display the (last 20 posts) and (last 20 comments). For 1.0
Dessalines implemented combined queries, so that the new endpoint /api/v4/person/content
returns the last 20 (posts and comments). See the issue and linked pull requests for more details.
The combined endpoints are:
GET /api/v4/person/content
GET /api/v4/account/inbox
GET /api/v4/account/saved
GET /api/v4/modlog
GET /api/v4/report/list
GET /api/v4/search
Note that the endpoints for modlog, report list and search also return combined data in API v3 on Lemmy 0.19
, because making them backwards compatible would require an unreasonable amount of work.
Image endpoints
Uploading or deleting avatars, icons and banners is done through separate endpoints now. With this change it is possible to disable image uploads, while still allowing changes to avatars etc.
The endpoints for image upload and proxying have been moved to GET /api/v4/image/{filename}
and GET /api/v4/image/proxy
respectively.
https://github.com/LemmyNet/lemmy/pull/5260
Other Breaking Changes
This list is likely incomplete.
- Adding a default_comment_sort_type column for local_site and local_user
- Removing local_user.show_scores column, since its now on the local_user_vote_display_mode table.
- Move custom emojis and tagline views to separate endpoints
- Remove pointless block_views
- Adding ability to restore content on user unban
- Changing list_logins to return a ListLoginsResponse object.
- Remove pointless local_user_id from LocalUserVoteDisplayMode
- Remove enable nsfw
- Instance blocks with mod log entry and expiration
- Rename actor_id columns to ap_id
- Include saved date in api responses
New Features (not breaking)
This list is definitely incomplete, and more features will be added before the final release.
- New parameters for GET /api/v4/search
- New parameters for GET /api/v4/post/list
- Adding a get_random_community endpoint. - GET /api/v4/community/random
- Adding a can_mod field to CommentView, PostView, and CommunityView. (not yet merged)
- Private communities
- SSO support
- Request idempodency support
- Add support for donation dialog
- Return correct status code for rate limit error
- Add media filter setting
- Post scheduling
- Slim comment views - GET
/api/v4/comment/list/slim