2016-07-12 18:22:33 +02:00
|
|
|
# Copyright 2016 OpenMarket Ltd
|
|
|
|
|
#
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
|
#
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
#
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
|
# limitations under the License.
|
2023-06-07 14:16:29 +02:00
|
|
|
openapi: 3.1.0
|
2015-11-11 12:39:40 +01:00
|
|
|
info:
|
2025-05-21 17:43:02 +02:00
|
|
|
title: Matrix Client-Server Published Room Directory API
|
2023-06-07 14:16:29 +02:00
|
|
|
version: 1.0.0
|
2015-11-11 12:39:40 +01:00
|
|
|
paths:
|
2018-03-03 22:46:40 +01:00
|
|
|
"/directory/list/room/{roomId}":
|
|
|
|
|
get:
|
|
|
|
|
summary: Gets the visibility of a room in the directory
|
2025-05-21 17:43:02 +02:00
|
|
|
description: |-
|
|
|
|
|
Gets the visibility of a given room in the server's
|
|
|
|
|
published room directory.
|
2018-03-03 22:46:40 +01:00
|
|
|
operationId: getRoomVisibilityOnDirectory
|
|
|
|
|
parameters:
|
|
|
|
|
- in: path
|
|
|
|
|
name: roomId
|
|
|
|
|
description: The room ID.
|
|
|
|
|
required: true
|
2023-06-07 14:16:29 +02:00
|
|
|
example: "!curbf:matrix.org"
|
|
|
|
|
schema:
|
|
|
|
|
type: string
|
2018-03-03 22:46:40 +01:00
|
|
|
responses:
|
2023-06-07 14:16:29 +02:00
|
|
|
"200":
|
2025-05-21 17:43:02 +02:00
|
|
|
description: The visibility of the room in the directory.
|
2023-06-07 14:16:29 +02:00
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
type: object
|
|
|
|
|
properties:
|
|
|
|
|
visibility:
|
|
|
|
|
type: string
|
|
|
|
|
enum:
|
|
|
|
|
- private
|
|
|
|
|
- public
|
|
|
|
|
description: The visibility of the room in the directory.
|
|
|
|
|
examples:
|
|
|
|
|
response:
|
|
|
|
|
value: {
|
|
|
|
|
"visibility": "public"
|
|
|
|
|
}
|
|
|
|
|
"404":
|
2025-05-21 17:43:02 +02:00
|
|
|
description: The room is not known to the server.
|
2023-06-07 14:16:29 +02:00
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
$ref: definitions/errors/error.yaml
|
|
|
|
|
examples:
|
|
|
|
|
response:
|
|
|
|
|
value: {
|
|
|
|
|
"errcode": "M_NOT_FOUND",
|
|
|
|
|
"error": "Room not found"
|
|
|
|
|
}
|
2021-08-10 19:24:37 +02:00
|
|
|
tags:
|
|
|
|
|
- Room discovery
|
2018-03-03 22:46:40 +01:00
|
|
|
put:
|
2025-05-21 17:43:02 +02:00
|
|
|
summary: Sets the visibility of a room in the directory
|
2018-03-03 22:46:40 +01:00
|
|
|
description: |-
|
2025-05-21 17:43:02 +02:00
|
|
|
Sets the visibility of a given room in the server's published room directory.
|
2018-03-06 16:51:57 +01:00
|
|
|
|
2025-05-21 17:43:02 +02:00
|
|
|
Servers MAY implement additional access control checks, for instance,
|
|
|
|
|
to ensure that a room's visibility can only be changed by the room creator
|
|
|
|
|
or a server administrator.
|
2018-03-03 22:46:40 +01:00
|
|
|
operationId: setRoomVisibilityOnDirectory
|
|
|
|
|
security:
|
2024-04-09 18:12:30 +02:00
|
|
|
- accessTokenQuery: []
|
|
|
|
|
- accessTokenBearer: []
|
2018-03-03 22:46:40 +01:00
|
|
|
parameters:
|
|
|
|
|
- in: path
|
|
|
|
|
name: roomId
|
|
|
|
|
description: The room ID.
|
|
|
|
|
required: true
|
2023-06-07 14:16:29 +02:00
|
|
|
example: "!curbf:matrix.org"
|
2018-03-03 22:46:40 +01:00
|
|
|
schema:
|
2023-06-07 14:16:29 +02:00
|
|
|
type: string
|
|
|
|
|
requestBody:
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
type: object
|
|
|
|
|
properties:
|
|
|
|
|
visibility:
|
|
|
|
|
type: string
|
|
|
|
|
enum:
|
|
|
|
|
- private
|
|
|
|
|
- public
|
|
|
|
|
description: |-
|
|
|
|
|
The new visibility setting for the room.
|
2025-05-21 17:43:02 +02:00
|
|
|
Defaults to `public`.
|
2023-06-07 14:16:29 +02:00
|
|
|
example: {
|
|
|
|
|
"visibility": "public"
|
|
|
|
|
}
|
2025-05-21 17:43:02 +02:00
|
|
|
description: The new visibility for the room in the published room directory.
|
2023-06-07 14:16:29 +02:00
|
|
|
required: true
|
2018-03-03 22:46:40 +01:00
|
|
|
responses:
|
2023-06-07 14:16:29 +02:00
|
|
|
"200":
|
2018-03-03 22:46:40 +01:00
|
|
|
description: The visibility was updated, or no change was needed.
|
2023-06-07 14:16:29 +02:00
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
type: object
|
|
|
|
|
examples:
|
|
|
|
|
response:
|
|
|
|
|
value: {}
|
|
|
|
|
"404":
|
2025-05-21 17:43:02 +02:00
|
|
|
description: The room is not known to the server.
|
2023-06-07 14:16:29 +02:00
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
$ref: definitions/errors/error.yaml
|
|
|
|
|
examples:
|
|
|
|
|
response:
|
|
|
|
|
value: {
|
|
|
|
|
"errcode": "M_NOT_FOUND",
|
|
|
|
|
"error": "Room not found"
|
|
|
|
|
}
|
2021-08-10 19:24:37 +02:00
|
|
|
tags:
|
|
|
|
|
- Room discovery
|
2023-06-07 14:16:29 +02:00
|
|
|
/publicRooms:
|
2015-11-11 12:39:40 +01:00
|
|
|
get:
|
2025-05-21 17:43:02 +02:00
|
|
|
summary: Lists a server's published room directory
|
2015-11-11 12:39:40 +01:00
|
|
|
description: |-
|
2025-05-21 17:43:02 +02:00
|
|
|
Lists a server's published room directory.
|
2015-11-11 12:39:40 +01:00
|
|
|
|
2016-10-14 11:31:06 +02:00
|
|
|
This API returns paginated responses. The rooms are ordered by the number
|
2016-11-21 14:08:41 +01:00
|
|
|
of joined members, with the largest rooms first.
|
2017-08-03 01:19:34 +02:00
|
|
|
operationId: getPublicRooms
|
2016-09-29 11:47:37 +02:00
|
|
|
parameters:
|
|
|
|
|
- in: query
|
|
|
|
|
name: limit
|
2023-06-07 14:16:29 +02:00
|
|
|
description: Limit the number of results returned.
|
|
|
|
|
schema:
|
|
|
|
|
type: integer
|
2016-09-29 11:47:37 +02:00
|
|
|
- in: query
|
|
|
|
|
name: since
|
|
|
|
|
description: |-
|
|
|
|
|
A pagination token from a previous request, allowing clients to
|
2016-10-11 15:24:46 +02:00
|
|
|
get the next (or previous) batch of rooms.
|
2016-10-11 15:29:20 +02:00
|
|
|
The direction of pagination is specified solely by which token
|
|
|
|
|
is supplied, rather than via an explicit flag.
|
2023-06-07 14:16:29 +02:00
|
|
|
schema:
|
|
|
|
|
type: string
|
2016-09-29 11:47:37 +02:00
|
|
|
- in: query
|
|
|
|
|
name: server
|
|
|
|
|
description: |-
|
2025-05-21 17:43:02 +02:00
|
|
|
The server to fetch the published room directory from. Defaults
|
|
|
|
|
to the local server. Case sensitive.
|
2023-06-07 14:16:29 +02:00
|
|
|
schema:
|
|
|
|
|
type: string
|
2016-09-29 11:59:14 +02:00
|
|
|
responses:
|
2023-06-07 14:16:29 +02:00
|
|
|
"200":
|
2025-05-21 17:43:02 +02:00
|
|
|
description: A list of the published rooms on the server.
|
2023-06-07 14:16:29 +02:00
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
$ref: definitions/public_rooms_response.yaml
|
2016-10-11 15:27:49 +02:00
|
|
|
tags:
|
|
|
|
|
- Room discovery
|
2016-09-29 11:59:14 +02:00
|
|
|
post:
|
2025-05-21 17:43:02 +02:00
|
|
|
summary: Lists a server's published room directory with an optional filter
|
2016-09-29 11:59:14 +02:00
|
|
|
description: |-
|
2025-05-21 17:43:02 +02:00
|
|
|
Lists a server's published room directory with an optional filter.
|
2016-09-29 11:59:14 +02:00
|
|
|
|
2016-10-14 11:31:06 +02:00
|
|
|
This API returns paginated responses. The rooms are ordered by the number
|
2016-11-21 14:08:41 +01:00
|
|
|
of joined members, with the largest rooms first.
|
2017-08-03 01:19:34 +02:00
|
|
|
operationId: queryPublicRooms
|
2016-09-29 12:06:57 +02:00
|
|
|
security:
|
2024-04-09 18:12:30 +02:00
|
|
|
- accessTokenQuery: []
|
|
|
|
|
- accessTokenBearer: []
|
2016-09-29 11:59:14 +02:00
|
|
|
parameters:
|
|
|
|
|
- in: query
|
|
|
|
|
name: server
|
|
|
|
|
description: |-
|
2025-05-21 17:43:02 +02:00
|
|
|
The server to fetch the published room directory from. Defaults
|
|
|
|
|
to the local server. Case sensitive.
|
2016-09-29 11:59:14 +02:00
|
|
|
schema:
|
2023-06-07 14:16:29 +02:00
|
|
|
type: string
|
|
|
|
|
requestBody:
|
|
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
type: object
|
|
|
|
|
properties:
|
|
|
|
|
limit:
|
|
|
|
|
type: integer
|
|
|
|
|
description: Limit the number of results returned.
|
|
|
|
|
since:
|
|
|
|
|
type: string
|
|
|
|
|
description: |-
|
|
|
|
|
A pagination token from a previous request, allowing clients
|
|
|
|
|
to get the next (or previous) batch of rooms. The direction
|
|
|
|
|
of pagination is specified solely by which token is supplied,
|
|
|
|
|
rather than via an explicit flag.
|
|
|
|
|
filter:
|
|
|
|
|
type: object
|
|
|
|
|
title: Filter
|
|
|
|
|
description: Filter to apply to the results.
|
|
|
|
|
properties:
|
2016-09-29 11:59:14 +02:00
|
|
|
generic_search_term:
|
|
|
|
|
type: string
|
|
|
|
|
description: |-
|
2022-08-04 23:15:16 +02:00
|
|
|
An optional string to search for in the room metadata, e.g. name,
|
|
|
|
|
topic, canonical alias, etc.
|
|
|
|
|
room_types:
|
|
|
|
|
type: array
|
|
|
|
|
x-addedInMatrixVersion: "1.4"
|
|
|
|
|
items:
|
2023-06-13 16:12:25 +02:00
|
|
|
type: ["string", "null"]
|
2022-08-04 23:15:16 +02:00
|
|
|
description: |-
|
|
|
|
|
An optional list of [room types](/client-server-api/#types) to search
|
|
|
|
|
for. To include rooms without a room type, specify `null` within this
|
|
|
|
|
list. When not specified, all applicable rooms (regardless of type)
|
|
|
|
|
are returned.
|
2023-06-07 14:16:29 +02:00
|
|
|
include_all_networks:
|
|
|
|
|
type: boolean
|
|
|
|
|
description: |-
|
|
|
|
|
Whether or not to include all known networks/protocols from
|
|
|
|
|
application services on the homeserver. Defaults to false.
|
|
|
|
|
example: false
|
|
|
|
|
third_party_instance_id:
|
|
|
|
|
type: string
|
|
|
|
|
description: |-
|
|
|
|
|
The specific third-party network/protocol to request from the
|
|
|
|
|
homeserver. Can only be used if `include_all_networks` is false.
|
2025-02-13 18:29:56 +01:00
|
|
|
|
|
|
|
|
This is the `instance_id` of a `Protocol Instance` returned by
|
|
|
|
|
[`GET /_matrix/client/v3/thirdparty/protocols`](/client-server-api/#get_matrixclientv3thirdpartyprotocols).
|
2023-06-07 14:16:29 +02:00
|
|
|
example: irc
|
|
|
|
|
example: {
|
|
|
|
|
"limit": 10,
|
|
|
|
|
"filter": {
|
|
|
|
|
"generic_search_term": "foo",
|
|
|
|
|
"room_types": [
|
|
|
|
|
null,
|
|
|
|
|
"m.space"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"include_all_networks": false,
|
2025-02-13 18:29:56 +01:00
|
|
|
"third_party_instance_id": "irc-freenode"
|
2023-06-07 14:16:29 +02:00
|
|
|
}
|
|
|
|
|
description: Options for which rooms to return.
|
|
|
|
|
required: true
|
2015-11-11 12:39:40 +01:00
|
|
|
responses:
|
2023-06-07 14:16:29 +02:00
|
|
|
"200":
|
2025-05-21 17:43:02 +02:00
|
|
|
description: A filtered list of the published rooms on the server.
|
2023-06-07 14:16:29 +02:00
|
|
|
content:
|
|
|
|
|
application/json:
|
|
|
|
|
schema:
|
|
|
|
|
$ref: definitions/public_rooms_response.yaml
|
2015-12-07 13:45:13 +01:00
|
|
|
tags:
|
|
|
|
|
- Room discovery
|
2023-06-07 14:16:29 +02:00
|
|
|
servers:
|
|
|
|
|
- url: "{protocol}://{hostname}{basePath}"
|
|
|
|
|
variables:
|
|
|
|
|
protocol:
|
|
|
|
|
enum:
|
|
|
|
|
- http
|
|
|
|
|
- https
|
|
|
|
|
default: https
|
|
|
|
|
hostname:
|
|
|
|
|
default: localhost:8008
|
|
|
|
|
basePath:
|
|
|
|
|
default: /_matrix/client/v3
|
2024-04-09 18:12:30 +02:00
|
|
|
components:
|
|
|
|
|
securitySchemes:
|
|
|
|
|
accessTokenQuery:
|
|
|
|
|
$ref: definitions/security.yaml#/accessTokenQuery
|
|
|
|
|
accessTokenBearer:
|
|
|
|
|
$ref: definitions/security.yaml#/accessTokenBearer
|