Proposed Changes to Community Endpoints in Piefed 1.2
Proposed Changes to Community Endpoints in Piefed 1.2
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: