---
title: "Get the list of rooms that the user shares with another user."
method: GET
path: "/_matrix/client/v1/mutual_rooms"
tags: ["Mutual Rooms"]
---

# Get the list of rooms that the user shares with another user.

`GET /_matrix/client/v1/mutual_rooms`

## Request

- Base URL: `https://matrix.org`
- URL: `https://matrix.org/_matrix/client/v1/mutual_rooms`
- 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/v1/mutual_rooms/get.ts> (a function with typed inputs; its response is checked against the schema)

Get the list of rooms that the user shares with another user. The
server will return a list of room IDs that the user shares with the
specified `user_id`.

## Query parameters

- `user_id` string, mx-user-id, required
- `from` string

## Response `200`

A list of room IDs that the user shares with the specified user.
If the provided `user_id` is not a valid user, the server MUST return an empty list of rooms.

- object
  - `count` integer, required: The number of such rooms. This is the total count even if the response is batched and `joined` doesn't include all rooms. This MAY be inaccurate if the server is unable to calculate the exact number of rooms.
  - `joined` string[], required: A list of room IDs where both the authenticated user and `user_id` have a membership of type `join`.
  - `next_batch` string: A pagination token to retrieve the next batch of results. This will be absent if there are no more results to return.

## Other responses

- `400`: Part of the request was invalid. The `from` token provided was invalid or expired, the `user_id` parameter was missing, [non-compliant](https://spec.matrix.org/v1.19/appendices/#historical-user-ids), or was the sender's own user ID.
- `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)
