As part of our ongoing effort to make our api self-documenting and validating our api input/output, we have been working through the api endpoints one at a time to make things a bit more consistent and logical. I just finished doing this for our existing /community endpoints and thought I would share the changelog here for awareness and feedback.
As of right now, these changes are only live on my instance and on our new, dedicated testing instance, crust.piefed.social. The self-documenting swagger for 1.2 (a WIP) can be found here.
1.2 Community Endpoints Changelog
PUT /community- input parameter
community_idproperly documented (was previously erroneously documented asid)
- input parameter
GET /community/list- made
next_pagenullable if there is no next page - this change was backported to 1.1 already
- made
GET /community/moderate/bansbanned_byreplacesbannedBy- transitioning everything to snake casebanned_userreplacesbannedUser- transitioning everything to snake caseexpired_atreplacesexpiredAt- transitioning everything to snake caseexpired_atvalue ofnullindicates a permanent banexpired_atonly returned if ban has expiredexpires_atfield added, only returned if ban is still in effectexpires_atvalue ofnullindicates permanent ban
PUT /community/moderate/unban- same field name changes as above (snake_case instead of camelCase)
expired_atis now set equal to current time if ban was found (indicating that it was just set to expired) and returned in standard timestamp format found elsewhere in the api (2025-06-07T02:29:07.980084Z)
POST /community/moderate/ban- Input:
expires_atreplacesexpiredAt/expired_atfor inputexpires_atuses standard timestamp format (2025-06-07T02:29:07.980084Z)expires_atis optionalexpires_atis checked to make sure it is in the future, raises an exception if it is notpermanentis new optional boolean field, supercedesexpires_atif true- If
expires_atis not provided andpermanentis either false or not provided, then the ban is set to expire in one year
- Output:
- same field name changes as above (snake_case instead of camelCase)
expires_atvalue ofnullindicates permanent ban- standardize timestamp format of
expires_at - only returns
expires_atbecause it is a time in the future (does not returnexpired_at)
- Input:
The case inconsistencies with the
moderateendpoints come from them being inspired by Mbin rather than Lemmy.For max consistency, it might be an idea to kill
moderate/unbanand just send a Boolean tomoderate/ban(e.g. with “banned”: true/false)I actually kind of like it being a separate endpoint, so I don’t mind that. One thing I thought about changing though, that I opted not to, was to make both
/banand/unbanthe same request method. Right now/banis a post while/unbanis a put. I feel like they should both be the same. However, this felt like more of a bigger change than some field name tweaking, so I held off.


