matrix-doc/api/client-server/v1/directory.yaml

107 lines
2.9 KiB
YAML

swagger: '2.0'
info:
title: "Matrix Client-Server v1 Directory API"
version: "1.0.0"
host: localhost:8008
schemes:
- https
- http
basePath: /_matrix/client/api/v1/directory
consumes:
- application/json
produces:
- application/json
securityDefinitions:
accessToken:
type: apiKey
description: The user_id or application service access_token
name: access_token
in: query
paths:
"/room/{roomAlias}":
put:
summary: Create a new mapping from room alias to room ID.
security:
- accessToken: []
parameters:
- in: path
type: string
name: roomAlias
description: The room alias to set.
required: true
x-example: "#coffee:example.com"
- in: body
name: roomInfo
description: Information about this room alias.
required: true
schema:
type: object
example: |-
{
"room_id": "!AfafhafwefwiugefSD:example.com"
}
properties:
room_id:
type: string
description: The room ID to set.
responses:
200:
description: The mapping was created.
examples:
application/json: |-
{}
schema:
type: object # empty json object
get:
summary: Get the room ID corresponding to this room alias.
parameters:
- in: path
type: string
name: roomAlias
description: The room alias.
required: true
x-example: "#coffee:example.com"
responses:
200:
description: The room ID and other information for this alias.
examples:
application/json: |-
{
"room_id": "!AfafhafwefwiugefSD:example.com",
"servers": ["example.com", "testing.com"]
}
schema:
type: object
properties:
room_id:
type: string
description: The room ID for this room alias.
servers:
type: array
description: A list of servers that are aware of this room ID.
items:
type: string
description: A server which is aware of this room ID.
404:
description: There is no mapped room ID for this room alias.
delete:
summary: Remove a mapping of room alias to room ID.
security:
- accessToken: []
parameters:
- in: path
type: string
name: roomAlias
description: The room alias to remove.
required: true
x-example: "#coffee:example.com"
responses:
200:
description: The mapping was removed.
examples:
application/json: |-
{}
schema:
type: object # empty json object