From 174fcf2821d2c9bfffd5431680a7ed1062ed71e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Sat, 1 Oct 2022 19:23:49 +0200 Subject: [PATCH] Receipts: Add thread_id to the /receipt endpoint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It seems to have been omitted in #1255 Signed-off-by: Kévin Commaille --- data/api/client-server/receipts.yaml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/data/api/client-server/receipts.yaml b/data/api/client-server/receipts.yaml index a4dabdd2..d22edb1e 100644 --- a/data/api/client-server/receipts.yaml +++ b/data/api/client-server/receipts.yaml @@ -74,8 +74,18 @@ paths: required: true schema: type: object + properties: + thread_id: + type: string + x-addedInMatrixVersion: "1.4" + description: |- + The root thread event's ID (or `main`) for which + thread this receipt is intended to be under. If + not specified, the read receipt is *unthreaded* + (default). example: { - } + "thread_id": "main" + } responses: 200: description: The receipt was sent. @@ -88,5 +98,17 @@ paths: description: This request was rate-limited. schema: "$ref": "definitions/errors/rate_limited.yaml" + 400: + description: |- + The `thread_id is not a string, or is empty, or it is provided for + a receipt of type `m.fully_read`, or the `event_id` is not related + to the `thread_id`. + schema: + $ref: "definitions/errors/error.yaml" + examples: + application/json: { + "errcode": "M_INVALID_PARAM", + "error": "thread_id field must be a non-empty string" + } tags: - Room participation