Skip to main content
Ban Member
Sets a member’s status to "banned", in this space and the child spaces where they are an active member (a pending or rejected request in a child space is left as it is), and ends their membership of those spaces’ chats, so they can no longer post to them, receive them or read their history (see space conversations). A request to join that is still pending can be banned too. Requires the caller to be a moderator or admin. Moderators can only ban regular members. Only the space’s owner (its userId: the creator of a top-level space, the root space’s creator for a sub-space) can ban admins, and the last admin cannot be banned. The space’s owner can’t be banned: they are an admin only they could ban, and this route refuses their own id.

Path Parameters

string
required
UUID of the space.
string
required
UUID of the user to ban: the member’s user id, not their membership id. Your own id is refused (400 space/own-member-id): your own membership is /spaces/:spaceId/members/me.

Body

string
Optional reason for the ban, kept with who banned them in the space’s ban log.
string
Required with a service key: the user this request acts as. The request has exactly that user’s permissions, so it is refused unless they are a moderator or admin of the space, and it is recorded as theirs. A user token always acts as its own user and must not send it (400 space/acting-user-not-allowed).

Response

The banned membership record, as a SpaceMember object.
string
Membership id.
string
The space.
string
The member.
'admin' | 'moderator' | 'member'
The member’s role.
'pending' | 'active' | 'banned' | 'rejected'
Always banned.
string
When the membership became active (ISO 8601).
string
When the membership record was created (ISO 8601).

Error Responses

Returned when spaceId or userId isn’t a valid UUID. Checked before sign-in, permissions and the endpoint’s other checks.
userId is the acting user (the token’s user, or the user named by actingUserId). This route acts on another member; check your own membership with GET /spaces/:spaceId/members/me and leave with DELETE /spaces/:spaceId/members/me.
A service key sent no actingUserId.
actingUserId is not a user id.
A user token sent actingUserId, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.
actingUserId was sent in the query string. On this endpoint every field, actingUserId included, goes in the request body.
Returned when a service key names an actingUserId that isn’t a user in this project.
The caller (or the user named by actingUserId) is not a moderator or admin of the space.
userId has no membership in this space.
The member is already banned here. The ban is still re-applied to their active memberships in child spaces, under the same rules as a first ban, so a repeated ban can instead return one of the errors below.
A moderator banning someone who is a moderator or admin in this space or in a child space the ban reaches. spaceId names that space.
Someone other than the space’s owner banning a member who is an admin in this space or in a child space the ban reaches. spaceId names that space.
The member is the last admin of this space or of a child space the ban reaches. spaceId names that space.
See also: useBanMember, Unban Member