Room membership

Ban a user in the room.

Ban a user in the room. If the user is currently in the room, also kick them.

When a user is banned from a room, they may not join it or be invited to it until they are unbanned.

The caller must have the required power level in order to perform this operation.

post/_matrix/client/v3/rooms/{roomId}/ban

Request

Path parameters

roomIdstring mx-room-id required

The room identifier (not alias) from which the user should be banned.

Request body

reasonstring

The reason the user has been banned. This will be supplied as the reason on the target's updated m.room.member event.

user_idstring mx-user-id required

The fully qualified user ID of the user being banned.

Example request

{
  "reason": "Telling unfunny jokes",
  "user_id": "@cheeky_monkey:matrix.org"
}

Response

The user has been kicked and banned from the room.

object required

Changes

No recorded changes to this operation across all 1 revision of this API.