---
title: "Unban a user from the room."
method: POST
path: "/_matrix/client/v3/rooms/{roomId}/unban"
tags: ["Room membership"]
---

# Unban a user from the room.

`POST /_matrix/client/v3/rooms/{roomId}/unban`

## Request

- Base URL: `https://matrix.org`
- URL: `https://matrix.org/_matrix/client/v3/rooms/{roomId}/unban`
- Auth: one of:
  - API key in query parameter `access_token`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/matrix/apis/matrix-client-server-api/docs/_matrix/client/v3/rooms/:roomId/unban/post.ts> (a function with typed inputs; its response is checked against the schema)

Unban a user from the room. This allows them to be invited to the room,
and join if they would otherwise be allowed to join according to its join rules.

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

## Path parameters

- `roomId` string, mx-room-id, required

## Request body

- object
  - `reason` string: Optional reason to be included as the `reason` on the subsequent membership event.
  - `user_id` string, mx-user-id, required: The fully qualified user ID of the user being unbanned.

## Response `200`

The user has been unbanned from the room.

- object

## Other responses

- `403`: You do not have permission to unban the user from the room. A meaningful `errcode` and description error text will be returned. Example reasons for rejections are: - The unbanner's power level is insufficient to unban users from the room.

---

[API](https://skmtc.dev/matrix/apis/matrix-client-server-api.md) - [All operations](https://skmtc.dev/matrix/apis/matrix-client-server-api/llms.txt) - [OpenAPI document](https://skmtc.dev/matrix/apis/matrix-client-server-api/revisions/c7fe4072c681?raw)
