# Copyright 2018, 2021 The Matrix.org Foundation C.I.C. # # 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. openapi: 3.1.0 info: title: Matrix Federation Published Room Directory API version: 1.0.0 paths: /publicRooms: get: summary: Lists the server's published room directory description: |- Lists the server's published room directory. This API returns paginated responses. The rooms are ordered by the number of joined members, with the largest rooms first. This SHOULD not return rooms that are listed on another homeserver's directory, just those listed on the receiving homeserver's directory. operationId: getPublicRooms security: - signedRequest: [] parameters: - in: query name: limit description: The maximum number of rooms to return. Defaults to 0 (no limit). example: 10 schema: type: integer - in: query name: since description: |- A pagination token from a previous call to this endpoint to fetch more rooms. example: GetMoreRoomsTokenHere schema: type: string - in: query name: include_all_networks description: |- Whether or not to include all networks/protocols defined by application services on the homeserver. Defaults to false. example: false schema: type: boolean - in: query name: third_party_instance_id description: |- The specific third-party network/protocol to request from the homeserver. Can only be used if `include_all_networks` is false. This is the `instance_id` of a `Protocol Instance` returned by [`GET /_matrix/client/v3/thirdparty/protocols`](/client-server-api/#get_matrixclientv3thirdpartyprotocols). example: irc-freenode schema: type: string responses: "200": description: A list of the published rooms on the server. content: application/json: schema: $ref: ../client-server/definitions/public_rooms_response.yaml post: summary: Lists the server's published room directory with an optional filter description: |- Lists the server's published room directory with an optional filter. This API returns paginated responses. The rooms are ordered by the number of joined members, with the largest rooms first. operationId: queryPublicRooms security: - signedRequest: [] 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 servers 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: generic_search_term: type: string description: |- 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: type: ["string", "null"] 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. 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. This is the `instance_id` of a `Protocol Instance` returned by [`GET /_matrix/client/v3/thirdparty/protocols`](/client-server-api/#get_matrixclientv3thirdpartyprotocols). example: irc-freenode example: { "limit": 10, "filter": { "generic_search_term": "foo", "room_types": [ null, "m.space" ] }, "include_all_networks": false, "third_party_instance_id": "irc-freenode" } description: Options for which rooms to return, or empty object to use defaults. required: true responses: "200": description: A filtered list of the published rooms on the server. content: application/json: schema: $ref: ../client-server/definitions/public_rooms_response.yaml servers: - url: "{protocol}://{hostname}{basePath}" variables: protocol: enum: - http - https default: https hostname: default: localhost:8448 basePath: default: /_matrix/federation/v1 components: securitySchemes: signedRequest: $ref: definitions/security.yaml#/signedRequest