Retrieve a portion of a space tree.

GET {{baseUrl}}/rooms/:roomId/hierarchy?suggested_only=true&limit=20&max_depth=5&from=next_batch_token

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.

Request Params

KeyDatatypeRequiredDescription
suggested_onlybooleanOptional (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.
limitnumberOptional 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_depth | number | | 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. | | from | string | | A pagination token from a previous result. If specified, max_depth and suggested_only cannot be changed from the first request. |

RESPONSES

status: OK

{"rooms":[{"room_id":"!space:example.org","avatar_url":"mxc://example.org/abcdef","guest_can_join":false,"name":"The First Space","topic":"No other spaces were created first, ever","world_readable":true,"join_rule":"public","room_type":"m.space","num_joined_members":42,"canonical_alias":"#general:example.org","children_state":[{"type":"m.space.child","state_key":"!a:example.org","content":{"via":["example.org"]},"sender":"@alice:example.org","origin_server_ts":1629413349153}]}],"next_batch":"next_batch_token"}