Event relationships

Get the child events for a given parent event.

Retrieve all of the child events for a given parent event.

Note that when paginating the from token should be "after" the to token in terms of topological ordering, because it is only possible to paginate "backwards" through events, starting at from.

For example, passing a from token from page 2 of the results, and a to token from page 1, would return the empty set. The caller can use a from token from page 1 and a to token from page 2 to paginate over the same range, however.

get/_matrix/client/v1/rooms/{roomId}/relations/{eventId}

Request

Path parameters

roomIdstring mx-room-id required

The ID of the room containing the parent event.

eventIdstring mx-event-id required

The ID of the parent event whose child events are to be returned.

Query parameters

fromstring

The pagination token to start returning results from. If not supplied, results start at the most recent topological event known to the server.

Can be a next_batch or prev_batch token from a previous call, or a returned start token from /messages, or a next_batch token from /sync.

tostring

The pagination token to stop returning results at. If not supplied, results continue up to limit or until there are no more events.

Like from, this can be a previous token from a prior call to this endpoint or from /messages or /sync.

limitinteger

The maximum number of results to return in a single chunk. The server can and should apply a maximum value to this parameter to avoid large responses.

Similarly, the server should apply a default value when not supplied.

dir'b' | 'f'

Optional (default b) direction to return events from. If this is set to f, events will be returned in chronological order starting at from. If it is set to b, events will be returned in reverse chronological order, again starting at from.

recurseboolean

Whether to additionally include events which only relate indirectly to the given event, i.e. events related to the given event via two or more direct relationships.

If set to false, only events which have a direct relation with the given event will be included.

If set to true, events which have an indirect relation with the given event will be included additionally up to a certain depth level. Homeservers SHOULD traverse at least 3 levels of relationships. Implementations MAY perform more but MUST be careful to not infinitely recurse.

The default value is false.

Response

The paginated child events which point to the parent. If no events are pointing to the parent or the pagination yields no results, an empty chunk is returned.

next_batchstring

An opaque string representing a pagination token. The absence of this token means there are no more results to fetch and the client should stop paginating.

prev_batchstring

An opaque string representing a pagination token. The absence of this token means this is the start of the result set, i.e. this is the first batch/page.

recursion_depthinteger

If the recurse parameter was supplied by the client, this response field is mandatory and gives the actual depth to which the server recursed. If the client did not specify the recurse parameter, this field must be absent.

Example response

{
  "chunk": [
    {
      "content": {
        "membership": "join"
      },
      "event_id": "$26RqwJMLw-yds1GAH_QxjHRC1Da9oasK0e5VLnck_45",
      "origin_server_ts": 1632489532305,
      "sender": "@example:example.org",
      "state_key": "@user:example.org",
      "type": "m.room.member",
      "unsigned": {
        "age": 1567437,
        "membership": "join",
        "redacted_because": {
          "content": {
            "reason": "spam"
          },
          "event_id": "$Nhl3rsgHMjk-DjMJANawr9HHAhLg4GcoTYrSiYYGqEE",
          "origin_server_ts": 1632491098485,
          "redacts": "$26RqwJMLw-yds1GAH_QxjHRC1Da9oasK0e5VLnck_45",
          "room_id": "!jEsUZKDJdhlrceRyVU:example.org",
          "sender": "@moderator:example.org",
          "type": "m.room.redaction",
          "unsigned": {
            "age": 1257
          }
        }
      },
      "room_id": "!jEsUZKDJdhlrceRyVU:example.org"
    }
  ]
}

Changes

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