Spaces

Retrieve a portion of a space tree.

Paginates over the space tree in a depth-first manner to locate child rooms of a given space.

Where a child room is unknown to the local server, federation is used to fill in the details. The servers listed in the via array should be contacted to attempt to fill in missing rooms.

Only m.space.child state events of the room are considered. Invalid child rooms and parent events are not covered by this endpoint.

get/_matrix/client/v1/rooms/{roomId}/hierarchy

Request

Path parameters

roomIdstring required

The room ID of the space to get a hierarchy for.

Query parameters

suggested_onlyboolean

Optional (default false) flag to indicate whether or not the server should only consider suggested rooms. Suggested rooms are annotated in their m.space.child event contents.

limitinteger

Optional limit for the maximum number of rooms to include per response. Must be an integer greater than zero.

Servers should apply a default value, and impose a maximum value to avoid resource exhaustion.

max_depthinteger

Optional limit for how far to go into the space. Must be a non-negative integer.

When reached, no further child rooms will be returned.

Servers should apply a default value, and impose a maximum value to avoid resource exhaustion.

fromstring

A pagination token from a previous result. If specified, max_depth and suggested_only cannot be changed from the first request.

Response

A portion of the space tree, starting at the provided room ID.

next_batchstring

A token to supply to from to keep paginating the responses. Not present when there are no further results.

Example response

{
  "rooms": [
    {
      "avatar_url": "mxc://example.org/abcdef",
      "canonical_alias": "#general:example.org",
      "guest_can_join": true,
      "join_rule": "public",
      "name": "General Chat",
      "num_joined_members": 42,
      "room_id": "!abcdefg:example.org",
      "topic": "All things general"
    }
  ]
}

Changes

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