Skip to main content
PATCH
/
:projectId
/
api
/
v7
/
spaces
/
:spaceId
/
members
/
:memberId
/
ban
Ban Member
curl --request PATCH \
  --url https://api.replyke.com/api/v6/:projectId/api/v7/spaces/:spaceId/members/:memberId/ban
{
  "message": "<string>",
  "membership": {}
}
Sets a member’s status to "banned". Requires the caller to be a moderator or admin. Moderators can only ban regular members. Only the space creator can ban admins, and the last admin cannot be banned.

Path Parameters

spaceId
string
required
UUID of the space.
memberId
string
required
UUID of the membership record to ban.

Response

message
string
Confirmation message.
membership
object
The updated membership record with status: "banned".

Error Responses

{ "error": "Membership not found.", "code": "space/membership-not-found" }
Moderators attempting to ban another moderator or admin.
{ "error": "Moderators can only remove regular members.", "code": "space/insufficient-permissions" }
Non-creator attempting to ban an admin.
{ "error": "Only the space creator can ban admins.", "code": "space/creator-required" }
{ "error": "Cannot remove the last admin. Promote another member to admin first.", "code": "space/last-admin" }
See also: useRemoveMember, Unban Member