summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/api.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/api.md b/docs/api.md
index ef211bc..e8c8c8c 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -127,6 +127,36 @@ Channel names must be unique. If a channel with the same name already exists, th
The API delivers events to clients to update them on other clients' actions and messages. While there is no specific delivery deadline, messages are delivered as soon as possible on a best-effort basis, and the event system allows clients to replay events or resume interrupted streams, to allow recovery if a message is lost.
+### `GET /api/channels/:channel/messages`
+
+Retrieves historical messages in a channel.
+
+The `:channel` placeholder must be a channel ID, as returned by `GET /api/channels` or `POST /api/channels`.
+
+#### Query parameters
+
+This endpoint accepts an optional `resume_point` query parameter. If provided, the value must be the value obtained from the `/api/boot` method. This parameter will restrict the returned list to messages as they existed at a fixed point in time, with any later changes only appearing in the event stream.
+
+#### On success
+
+Responds with a list of message objects, one per message:
+
+```json
+[
+ {
+ "at": "2024-09-27T23:19:10.208147Z",
+ "sender": {
+ "id": "L1234abcd",
+ "name": "example username"
+ },
+ "message": {
+ "id": "M1312acab",
+ "body": "beep"
+ }
+ }
+]
+```
+
### `POST /api/channels/:channel`
Sends a chat message to a channel. It will be relayed to clients subscribed to the channel's events, and recorded for replay.