---
title: "Stop the requesting user participating in a particular room."
method: POST
path: "/_matrix/client/v3/rooms/{roomId}/leave"
tags: ["Room membership"]
---

# Stop the requesting user participating in a particular room.

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

## Request

- Base URL: `https://matrix.org`
- URL: `https://matrix.org/_matrix/client/v3/rooms/{roomId}/leave`
- 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/leave/post.ts> (a function with typed inputs; its response is checked against the schema)

This API stops a user participating in a particular room.

If the user was already in the room, they will no longer be able to see
new events in the room. If the room requires an invite to join, they
will need to be re-invited before they can re-join.

If the user was invited to the room, but had not joined, this call
serves to reject the invite.

Servers MAY additionally forget the room when this endpoint is called –
just as if the user had also invoked [`/forget`](https://spec.matrix.org/v1.19/client-server-api/#post_matrixclientv3roomsroomidforget).
Servers that do this, MUST inform clients about this behavior using the
[`m.forget_forced_upon_leave`](https://spec.matrix.org/v1.19/client-server-api/#mforget_forced_upon_leave-capability)
capability.

If the server doesn't automatically forget the room, the user will still be
allowed to retrieve history from the room which they were previously allowed
to see.

## 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.

## Response `200`

The room has been left.

- object

## Other responses

- `429`: This request was rate-limited.

---

[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)
