2015-05-29 15:31:05 +02:00
swagger : '2.0'
info :
title : "Matrix Client-Server v1 Directory API"
version : "1.0.0"
2015-05-29 16:37:44 +02:00
host : localhost:8008
2015-05-29 15:31:05 +02:00
schemes :
- https
- http
basePath : /_matrix/client/api/v1/directory
consumes :
- application/json
produces :
- application/json
2015-05-29 16:18:09 +02:00
securityDefinitions :
accessToken :
type : apiKey
description : The user_id or application service access_token
name : access_token
in : query
2015-05-29 15:31:05 +02:00
paths :
"/room/{roomAlias}" :
put :
summary : Create a new mapping from room alias to room ID.
2015-05-29 16:18:09 +02:00
security :
- accessToken : [ ]
2015-05-29 15:31:05 +02:00
parameters :
- in : path
type : string
name : roomAlias
description : The room alias to set.
required : true
2015-11-26 16:03:39 +01:00
x-example : "#monkeys:matrix.org"
2015-05-29 15:31:05 +02:00
- in : body
name : roomInfo
description : Information about this room alias.
required : true
schema :
type : object
properties :
room_id :
type : string
description : The room ID to set.
2015-11-26 16:03:39 +01:00
example : |-
{
"room_id": "!abnjk1jdasj98:capuchins.com"
}
2015-05-29 15:31:05 +02:00
responses :
200 :
description : The mapping was created.
2015-11-26 16:03:39 +01:00
examples :
application/json : |-
{}
2015-05-29 15:31:05 +02:00
schema :
2015-11-26 16:03:39 +01:00
type : object
2015-05-29 15:31:05 +02:00
get :
summary : Get the room ID corresponding to this room alias.
parameters :
- in : path
type : string
name : roomAlias
description : The room alias.
required : true
2015-11-26 16:03:39 +01:00
x-example : "#monkeys:matrix.org"
2015-05-29 15:31:05 +02:00
responses :
200 :
description : The room ID and other information for this alias.
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.
2015-11-26 16:03:39 +01:00
examples :
application/json : |-
{
"room_id": "!abnjk1jdasj98:capuchins.com" ,
"servers": [
"capuchins.com" ,
"matrix.org" ,
"another.com"
]
}
2015-05-29 15:31:05 +02:00
404 :
description : There is no mapped room ID for this room alias.
2015-11-26 16:03:39 +01:00
examples :
application/json : |-
{
"errcode": "M_NOT_FOUND" ,
"error": "Room ID !abnjk1jdasj98:capuchins.com not found."
}
409 :
description : A room alias with that name already exists.
examples :
application/json : |-
{
"errcode": "M_UNKNOWN" ,
"error": "Room alias #monkeys:matrix.org already exists."
}
2015-05-29 15:31:05 +02:00
delete :
summary : Remove a mapping of room alias to room ID.
2015-11-26 16:03:39 +01:00
description : |-
Remove a mapping of room alias to room ID.
Servers may choose to implement additional access control checks here, for instance that room aliases can only be deleted by their creator or a server administrator.
2015-05-29 16:18:09 +02:00
security :
- accessToken : [ ]
2015-05-29 15:31:05 +02:00
parameters :
- in : path
type : string
name : roomAlias
description : The room alias to remove.
required : true
2015-11-26 16:03:39 +01:00
x-example : "#monkeys:matrix.org"
2015-05-29 15:31:05 +02:00
responses :
200 :
2015-11-26 16:03:39 +01:00
description : The mapping was deleted.
examples :
application/json : |-
{}
2015-05-29 15:31:05 +02:00
schema :
2015-11-26 16:03:39 +01:00
type : object