From ac2d2c5cfec3be5fb56003fce3f39a1a448f80c6 Mon Sep 17 00:00:00 2001 From: Hugh Nimmo-Smith Date: Wed, 24 Jul 2024 18:25:17 +0100 Subject: [PATCH] Pagination on GET endpoint --- proposals/4140-delayed-events-futures.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/proposals/4140-delayed-events-futures.md b/proposals/4140-delayed-events-futures.md index 045164585..440b9e5f8 100644 --- a/proposals/4140-delayed-events-futures.md +++ b/proposals/4140-delayed-events-futures.md @@ -132,6 +132,23 @@ Content-Type: application/json A new authenticated client-server API endpoint `GET /_matrix/client/v1/delayed_events` allows clients to get a list of all the delayed events that have been scheduled to send. +The endpoint accepts a query parameter `from` which is a token that can be used to paginate the list of delayed events as per the +[pagination convention](https://spec.matrix.org/v1.11/appendices/#pagination). The homeserver can choose a suitable page size. + +The response is a JSON object containing the following fields: + +- `delayed_events` - Required. An array of delayed events that have been scheduled to send. + - `delay_id` - Required. The ID of the delayed event. + - `room_id` - Required. The room ID of the delayed event. + - `type` - Required. The event type of the delayed event. + - `state_key` - Optional. The state key of the delayed event if it is a state event. + - `delay` - Required. The delay in milliseconds before the event is sent. + - `running_since` - Required. The timestamp (as unix time in milliseconds) when the delayed event was scheduled or last restarted. + - `content` - Required. The content of the delayed event. +- `next_batch` - Optional. A token that can be used to paginate the list of delayed events. + +For example: + ```http HTTP 200 OK Content-Type: application/json @@ -160,7 +177,8 @@ Content-Type: application/json "memberships": [] } } - ] + ], + "next_batch": "b12345" } ```