|
| 1 | +# Copyright 2025 The Matrix.org Foundation C.I.C. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | +openapi: 3.1.0 |
| 15 | +info: |
| 16 | + title: Matrix Client-Server Room Summary API |
| 17 | + version: 1.0.0 |
| 18 | +paths: |
| 19 | + "/room_summary/{roomIdOrAlias}": |
| 20 | + get: |
| 21 | + x-addedInMatrixVersion: "1.15" |
| 22 | + summary: Retrieves a summary for a room. |
| 23 | + description: |- |
| 24 | + Retrieves a summary for a room. |
| 25 | +
|
| 26 | + Clients should note that requests for rooms where the user's membership |
| 27 | + is `invite` or `knock` might yield outdated, partial or even no data |
| 28 | + since the server may not have access to the current state of the room. |
| 29 | +
|
| 30 | + Servers MAY allow unauthenticated access to this API if at least one of |
| 31 | + the following conditions holds true: |
| 32 | +
|
| 33 | + - The room has a [join rule](#mroomjoin_rules) of `public`, `knock` or |
| 34 | + `knock_restricted`. |
| 35 | + - The room has a `world_readable` [history visibility](#room-history-visibility). |
| 36 | +
|
| 37 | + Servers should consider rate limiting requests that require a federation |
| 38 | + request more heavily if the client is unauthenticated. |
| 39 | + operationId: getRoomSummary |
| 40 | + security: |
| 41 | + - signedRequest: [] |
| 42 | + parameters: |
| 43 | + - in: path |
| 44 | + name: roomIdOrAlias |
| 45 | + description: The room identifier or alias to summarise. |
| 46 | + required: true |
| 47 | + example: "#monkeys:matrix.org" |
| 48 | + schema: |
| 49 | + type: string |
| 50 | + - in: query |
| 51 | + name: via |
| 52 | + description: |- |
| 53 | + The servers to attempt to request the summary from when |
| 54 | + the local server cannot generate it (for instance, because |
| 55 | + it has no local user in the room). |
| 56 | + example: |
| 57 | + - matrix.org |
| 58 | + - elsewhere.ca |
| 59 | + schema: |
| 60 | + type: array |
| 61 | + items: |
| 62 | + type: string |
| 63 | + responses: |
| 64 | + "200": |
| 65 | + description: A summary of the room. |
| 66 | + content: |
| 67 | + application/json: |
| 68 | + schema: |
| 69 | + description: A summary of the room. |
| 70 | + allOf: |
| 71 | + - $ref: ../client-server/definitions/room_summary.yaml |
| 72 | + - type: object |
| 73 | + properties: |
| 74 | + membership: |
| 75 | + description: |- |
| 76 | + The membership state of the user if the user is joined to the room. Absent |
| 77 | + if the API was called unauthenticated. |
| 78 | + enum: |
| 79 | + - invite |
| 80 | + - join |
| 81 | + - knock |
| 82 | + - leave |
| 83 | + - ban |
| 84 | + type: string |
| 85 | + required: |
| 86 | + - guest_can_join |
| 87 | + - num_joined_members |
| 88 | + - room_id |
| 89 | + - world_readable |
| 90 | + examples: |
| 91 | + response: |
| 92 | + value: { |
| 93 | + room_id: "!ol19s:bleecker.street", |
| 94 | + avatar_url: "mxc://bleecker.street/CHEDDARandBRIE", |
| 95 | + guest_can_join: false, |
| 96 | + name: "CHEESE", |
| 97 | + num_joined_members: 37, |
| 98 | + topic: "Tasty tasty cheese", |
| 99 | + world_readable: true, |
| 100 | + join_rule: "public", |
| 101 | + room_type: "m.space", |
| 102 | + membership: "invite", |
| 103 | + encryption: "m.megolm.v1.aes-sha2", |
| 104 | + room_version: "9001", |
| 105 | + } |
| 106 | + "404": |
| 107 | + description: |- |
| 108 | + The room could not be found. |
| 109 | + content: |
| 110 | + application/json: |
| 111 | + schema: |
| 112 | + $ref: ../client-server/definitions/errors/error.yaml |
| 113 | + examples: |
| 114 | + response: |
| 115 | + value: { |
| 116 | + "errcode": "M_NOT_FOUND", |
| 117 | + "error": "Room not found." |
| 118 | + } |
| 119 | +servers: |
| 120 | + - url: "{protocol}://{hostname}{basePath}" |
| 121 | + variables: |
| 122 | + protocol: |
| 123 | + enum: |
| 124 | + - http |
| 125 | + - https |
| 126 | + default: https |
| 127 | + hostname: |
| 128 | + default: localhost:8008 |
| 129 | + basePath: |
| 130 | + default: /_matrix/client/v1 |
| 131 | +components: |
| 132 | + securitySchemes: |
| 133 | + accessTokenQuery: |
| 134 | + $ref: definitions/security.yaml#/accessTokenQuery |
| 135 | + accessTokenBearer: |
| 136 | + $ref: definitions/security.yaml#/accessTokenBearer |
0 commit comments