Skip to content

Commit b819299

Browse files
committed
Add server support discovery endpoint
As per MSC1929. Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
1 parent b136b35 commit b819299

File tree

2 files changed

+138
-0
lines changed

2 files changed

+138
-0
lines changed

content/client-server-api/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@ specify parameter values. The flow for this method is as follows:
363363

364364
{{% http-api spec="client-server" api="versions" %}}
365365

366+
{{% http-api spec="client-server" api="support" %}}
367+
366368
## Client Authentication
367369

368370
Most API endpoints require the user to identify themselves by presenting

data/api/client-server/support.yaml

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# Copyright 2018 New Vector Ltd
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 Support Discovery API
17+
version: 1.0.0
18+
paths:
19+
/matrix/support:
20+
get:
21+
summary: Gets Matrix server admin contact and support page of the domain.
22+
description: |-
23+
Gets server admin contact and support page of the domain.
24+
25+
Like the [well-known discovery URI](/client-server-api/#well-known-uri),
26+
this should be accessed with the hostname of the homeserver, by making a
27+
GET request to `https://hostname/.well-known/matrix/support`.
28+
29+
Note that this endpoint is not necessarily handled by the homeserver,
30+
but by another webserver, to be used for discovering support information
31+
for the homeserver.
32+
operationId: getWellknownSupport
33+
x-addedInMatrixVersion: "1.10"
34+
responses:
35+
"200":
36+
description: Server support information.
37+
content:
38+
application/json:
39+
schema:
40+
type: object
41+
properties:
42+
contacts:
43+
type: array
44+
description: |-
45+
Ways to contact the server administrator.
46+
47+
At least one of `contacts` or `support_page` is required.
48+
If only this is set, it must contain at least one item.
49+
items:
50+
type: object
51+
title: Contact
52+
description: A way to contact the server administrator.
53+
properties:
54+
matrix_id:
55+
type: string
56+
description: |-
57+
A Matrix User ID allowing to contact the
58+
administrator.
59+
60+
It could be an account registered on a different
61+
homeserver so the administrator can be contacted
62+
when the homeserver is down.
63+
64+
At least one of `matrix_id` or `email_address` is
65+
required.
66+
email_address:
67+
type: string
68+
description: |-
69+
An email address allowing to contact the
70+
administrator.
71+
72+
At least one of `matrix_id` or `email_address` is
73+
required.
74+
role:
75+
type: string
76+
enum:
77+
- "m.role.admin"
78+
- "m.role.security"
79+
description: |-
80+
An informal description of what the contact methods
81+
are used for.
82+
83+
`m.role.admin` is a catch-all user for any queries
84+
and `m.role.security` is intended for sensitive
85+
requests.
86+
87+
Unspecified roles are permitted through the use of
88+
[Namespaced Identifiers](/appendices/#common-namespaced-identifier-grammar).
89+
required:
90+
- role
91+
example: {
92+
"matrix_id": "@admin:example.org",
93+
"email_address": "admin@example.org",
94+
"role": "m.role.admin"
95+
}
96+
support_page:
97+
type: string
98+
description: |-
99+
The URL of a page to give users help specific to the
100+
homeserver, like extra login/registration steps.
101+
102+
At least one of `contacts` or `support_page` is required.
103+
example: "https://example.org/support.html"
104+
examples:
105+
response:
106+
value:
107+
{
108+
"contacts": [
109+
{
110+
"matrix_id": "@admin:example.org",
111+
"email_address": "admin@example.org",
112+
"role": "m.role.admin"
113+
},
114+
{
115+
"email_address": "security@example.org",
116+
"role": "m.role.security"
117+
}
118+
],
119+
"support_page": "https://example.org/support.html"
120+
}
121+
"404":
122+
description: No server support information available.
123+
tags:
124+
- Server administration
125+
servers:
126+
- url: "{protocol}://{hostname}{basePath}"
127+
variables:
128+
protocol:
129+
enum:
130+
- http
131+
- https
132+
default: https
133+
hostname:
134+
default: localhost:8008
135+
basePath:
136+
default: /.well-known

0 commit comments

Comments
 (0)