Skip to content

Commit 7935a07

Browse files
zecakehturt2live
andcommitted
Receipts: Add thread_id to the /receipt endpoint (#1261)
* Receipts: Add thread_id to the /receipt endpoint It seems to have been omitted in #1255 Signed-off-by: Kévin Commaille <[email protected]> * changelog Signed-off-by: Kévin Commaille <[email protected]> * Fix missing backtick * Apply suggestion for error description Co-authored-by: Travis Ralston <[email protected]> Signed-off-by: Kévin Commaille <[email protected]> Co-authored-by: Travis Ralston <[email protected]>
1 parent 2310562 commit 7935a07

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add `thread_id` to the `/receipt` endpoint, as per [MSC3771](https://github.com/matrix-org/matrix-spec-proposals/pull/3771)

data/api/client-server/receipts.yaml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,18 @@ paths:
7474
required: true
7575
schema:
7676
type: object
77+
properties:
78+
thread_id:
79+
type: string
80+
x-addedInMatrixVersion: "1.4"
81+
description: |-
82+
The root thread event's ID (or `main`) for which
83+
thread this receipt is intended to be under. If
84+
not specified, the read receipt is *unthreaded*
85+
(default).
7786
example: {
78-
}
87+
"thread_id": "main"
88+
}
7989
responses:
8090
200:
8191
description: The receipt was sent.
@@ -88,5 +98,19 @@ paths:
8898
description: This request was rate-limited.
8999
schema:
90100
"$ref": "definitions/errors/rate_limited.yaml"
101+
400:
102+
description: |-
103+
The `thread_id` is invalid in some way. For example:
104+
* It is not a string.
105+
* It is empty.
106+
* It is provided for an incompatible receipt type.
107+
* The `event_id` is not related to the `thread_id`.
108+
schema:
109+
$ref: "definitions/errors/error.yaml"
110+
examples:
111+
application/json: {
112+
"errcode": "M_INVALID_PARAM",
113+
"error": "thread_id field must be a non-empty string"
114+
}
91115
tags:
92116
- Room participation

0 commit comments

Comments
 (0)