@@ -51,26 +51,31 @@ paths:
5151 name : from
5252 description : |-
5353 The token to start returning events from. This token can be obtained
54- from a `prev_batch` token returned for each room by the sync API,
55- or from a `start` or `end` token returned by a previous request
56- to this endpoint.
54+ from a `prev_batch` or `next_batch` token returned by the `/sync` endpoint,
55+ or from an `end` token returned by a previous request to this endpoint.
56+
57+ This endpoint can also accept a value returned as a `start` token
58+ by a previous request to this endpoint, though servers are not
59+ required to support this. Clients should not rely on the behaviour.
5760 required : true
5861 x-example : " s345_678_333"
5962 - in : query
6063 type : string
6164 name : to
6265 description : |-
6366 The token to stop returning events at. This token can be obtained from
64- a `prev_batch` token returned for each room by the sync endpoint,
65- or from a `start` or `end` token returned by a previous request to
66- this endpoint.
67+ a `prev_batch` or `next_batch` token returned by the `/sync` endpoint,
68+ or from an `end` token returned by a previous request to this endpoint.
6769 required : false
6870 - in : query
6971 type : string
7072 enum : ["b", "f"]
7173 name : dir
7274 description : |-
73- The direction to return events from.
75+ The direction to return events from. If this is set to `f`, events
76+ will be returned in chronological order starting at `from`. If it
77+ is set to `b`, events will be returned in *reverse* chronolgical
78+ order, again starting at `from`.
7479 required : true
7580 x-example : " b"
7681 - in : query
@@ -96,20 +101,29 @@ paths:
96101 start :
97102 type : string
98103 description : |-
99- The token the pagination starts from. If `dir=b` this will be
100- the token supplied in `from`.
104+ A token corresponding to the start of `chunk`. This will be the same as
105+ the value given in `from`.
101106 end :
102107 type : string
103108 description : |-
104- The token the pagination ends at. If `dir=b` this token should
105- be used again to request even earlier events.
109+ A token corresponding to the end of `chunk`. This token can be passed
110+ back to this endpoint to request further events.
111+
112+ If no further events are available (either because we have
113+ reached the start of the timeline, or because the user does
114+ not have permission to see any more events), this property
115+ is omitted from the response.
106116 chunk :
107117 type : array
108118 description : |-
109119 A list of room events. The order depends on the `dir` parameter.
110120 For `dir=b` events will be in reverse-chronological order,
111- for `dir=f` in chronological order, so that events start
112- at the `from` point.
121+ for `dir=f` in chronological order. (The exact definition of `chronological`
122+ is dependent on the server implementation.)
123+
124+ Note that an empty `chunk` does not *necessarily* imply that no more events
125+ are available. Clients should continue to paginate until no `end` property
126+ is returned.
113127 items :
114128 " $ref " : " ../../event-schemas/schema/core-event-schema/room_event.yaml"
115129 state :
@@ -125,6 +139,7 @@ paths:
125139 the membership of those members has not changed.
126140 items :
127141 $ref : " ../../event-schemas/schema/core-event-schema/state_event.yaml"
142+ required : [start, chunk]
128143 examples :
129144 application/json : {
130145 " start " : " t47429-4392820_219380_26003_2265" ,
0 commit comments