-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathswagger.yaml
More file actions
1503 lines (1503 loc) · 48 KB
/
Copy pathswagger.yaml
File metadata and controls
1503 lines (1503 loc) · 48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
consumes:
- application/json
definitions:
github_com_etkecc_mrs_internal_model.ClientVersions:
properties:
unstable_features:
additionalProperties:
type: boolean
description: unstable MSCs we actually honor
type: object
versions:
description: advertised client-server spec versions
items:
type: string
type: array
type: object
github_com_etkecc_mrs_internal_model.Entry:
properties:
alias:
type: string
avatar:
type: string
avatar_url:
type: string
guest_can_join:
type: boolean
id:
type: string
join_rule:
type: string
language:
type: string
members:
type: integer
name:
type: string
room_type:
type: string
server:
description: server of origin
type: string
servers:
description: comma-separated list of servers
type: string
topic:
type: string
type:
type: string
world_readable:
type: boolean
type: object
github_com_etkecc_mrs_internal_model.IndexStats:
properties:
discovery:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.IndexStatsTime'
indexing:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.IndexStatsTime'
parsing:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.IndexStatsTime'
rooms:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.IndexStatsRooms'
servers:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.IndexStatsServers'
type: object
github_com_etkecc_mrs_internal_model.IndexStatsRooms:
properties:
banned:
type: integer
indexed:
type: integer
parsed:
type: integer
reported:
type: integer
type: object
github_com_etkecc_mrs_internal_model.IndexStatsServers:
properties:
blocked:
type: integer
indexable:
type: integer
online:
type: integer
software:
additionalProperties:
type: integer
type: object
type: object
github_com_etkecc_mrs_internal_model.IndexStatsTime:
properties:
finished_at:
type: string
started_at:
type: string
type: object
github_com_etkecc_mrs_internal_model.MatrixError:
properties:
errcode:
description: Matrix error code, e.g M_UNAUTHORIZED
type: string
error:
description: Matrix error message
type: string
type: object
github_com_etkecc_mrs_internal_model.MatrixRoom:
properties:
avatar_url:
type: string
avatar_url_http:
type: string
canonical_alias:
type: string
email:
type: string
guest_can_join:
type: boolean
join_rule:
type: string
language:
type: string
name:
type: string
num_joined_members:
type: integer
parsed_at:
type: string
room_id:
type: string
room_type:
type: string
server:
description: Parsed (custom) fields
type: string
servers:
items:
type: string
type: array
topic:
type: string
world_readable:
type: boolean
type: object
github_com_etkecc_mrs_internal_model.MatrixServer:
properties:
checked_at:
description: backoff clock, bumped on every dial attempt whether online or
not
type: string
contacts:
allOf:
- $ref: '#/definitions/github_com_etkecc_mrs_internal_model.MatrixServerContacts'
description: Contacts as per MSC1929
indexable:
description: Is the server's room directory published over federation?
type: boolean
name:
description: ServerName, as per spec, e.g., "example.com"
type: string
online:
description: Is the server online and federating?
type: boolean
online_at:
description: prune clock; merged with CheckedAt, dead servers go immortal
type: string
software:
description: Software running on the server, e.g., Synapse, Dendrite
type: string
url:
description: Server-Server API URL, e.g., "https://example.com:8448"
type: string
version:
description: Version of the software, e.g., 1.0.0
type: string
type: object
github_com_etkecc_mrs_internal_model.MatrixServerContacts:
properties:
emails:
items:
type: string
type: array
mxids:
items:
type: string
type: array
url:
type: string
type: object
github_com_etkecc_mrs_internal_model.QueryDirectoryResponse:
properties:
room_id:
type: string
servers:
items:
type: string
type: array
type: object
github_com_etkecc_mrs_internal_model.QueryServerKeysRequest:
properties:
server_keys:
additionalProperties: {}
type: object
type: object
github_com_etkecc_mrs_internal_model.RoomDirectoryFilter:
properties:
generic_search_term:
type: string
room_types:
items:
type: string
type: array
type: object
github_com_etkecc_mrs_internal_model.RoomDirectoryRequest:
properties:
filter:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.RoomDirectoryFilter'
limit:
type: integer
since:
type: string
type: object
github_com_etkecc_mrs_internal_model.RoomDirectoryResponse:
properties:
chunk:
items:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.RoomDirectoryRoom'
type: array
next_batch:
type: string
prev_batch:
type: string
total_room_count_estimate:
type: integer
type: object
github_com_etkecc_mrs_internal_model.RoomDirectoryRoom:
properties:
avatar_url:
type: string
canonical_alias:
type: string
guest_can_join:
type: boolean
join_rule:
type: string
name:
type: string
num_joined_members:
type: integer
room_id:
type: string
room_type:
type: string
topic:
type: string
world_readable:
type: boolean
type: object
github_com_etkecc_mrs_internal_model.RoomVisibility:
properties:
visibility:
description: always "public"
type: string
type: object
github_com_etkecc_mrs_internal_model.ServerKeys:
properties:
old_verify_keys:
additionalProperties:
additionalProperties: {}
type: object
description: rotated-out keys, kept so old signatures still verify
type: object
server_name:
description: the server these keys belong to
type: string
signatures:
additionalProperties:
additionalProperties:
type: string
type: object
description: server -> keyID -> signature over this object
type: object
valid_until_ts:
description: keys are trustworthy until this ms timestamp
type: integer
verify_keys:
additionalProperties:
additionalProperties:
type: string
type: object
description: 'keyID -> {"key": base64 ed25519 public key}'
type: object
type: object
github_com_etkecc_mrs_internal_model.ServerKeysQueryResponse:
properties:
server_keys:
description: each element is a signed ServerKeys object
items:
items:
format: int32
type: integer
type: array
type: array
type: object
github_com_etkecc_mrs_internal_model.ServerVersion:
properties:
server:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.ServerVersionInfo'
type: object
github_com_etkecc_mrs_internal_model.ServerVersionInfo:
properties:
name:
description: server software name
type: string
version:
description: server software version
type: string
type: object
github_com_etkecc_mrs_internal_model.StatsDetails:
properties:
rooms:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.StatsDetailsRooms'
servers:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.StatsDetailsServers'
type: object
github_com_etkecc_mrs_internal_model.StatsDetailsRooms:
properties:
indexed:
type: integer
parsed:
type: integer
type: object
github_com_etkecc_mrs_internal_model.StatsDetailsServers:
properties:
indexable:
type: integer
online:
type: integer
software:
additionalProperties:
type: integer
type: object
type: object
github_com_etkecc_mrs_internal_model.StatsResponse:
properties:
details:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.StatsDetails'
rooms:
type: integer
servers:
type: integer
timeline:
items:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.StatsTimelineEntry'
type: array
type: object
github_com_etkecc_mrs_internal_model.StatsTimelineEntry:
properties:
date:
type: string
details:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.StatsDetails'
type: object
github_com_etkecc_mrs_internal_model.WellKnownClient:
properties:
m.homeserver:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.WellKnownHomeserver'
type: object
github_com_etkecc_mrs_internal_model.WellKnownHomeserver:
properties:
base_url:
description: e.g. https://matrix.example.com
type: string
type: object
github_com_etkecc_mrs_internal_model.WellKnownServer:
properties:
m.server:
description: host:port, e.g. matrix.example.com:443
type: string
type: object
internal_controllers.reportSubmission:
properties:
no_msc1929:
type: boolean
reason:
type: string
roomID:
type: string
type: object
msc1929.Contact:
properties:
dev.zirco.msc4439.pgp_key:
type: string
email_address:
type: string
matrix_id:
type: string
role:
type: string
type: object
msc1929.Response:
properties:
admins:
description: Admins list, deprecated since Nov 15, 2023, but still used by
some servers
items:
$ref: '#/definitions/msc1929.Contact'
type: array
contacts:
description: Contacts list
items:
$ref: '#/definitions/msc1929.Contact'
type: array
support_page:
description: SupportPage URL
type: string
type: object
info:
contact: {}
description: Matrix Rooms Search crawls the Matrix federation and serves public-room
search. It also answers part of the Matrix federation and client-server APIs for
the rooms it has indexed. Where our implementation diverges from the spec, that
divergence is documented here on purpose, not hidden. matrixrooms.info is a public
demo running MRS.
license:
name: AGPL-3.0
url: https://www.gnu.org/licenses/agpl-3.0
title: Matrix Rooms Search API
version: 0.0.0
paths:
/-/discover:
post:
description: 'Kicks off a discovery pass and returns 201 immediately. Fire-and-forget:
the crawl runs in the background, this does not wait for it.'
produces:
- application/json
responses:
"201":
description: Discovery started in the background
security:
- AdminAuth: []
summary: Trigger discovery
tags:
- admin
/-/full:
post:
description: Runs a full cycle (discovery, then parsing) in one go and returns
201 immediately. Fire-and-forget, runs in the background. This is what a periodic
cron/timer should hit to keep the index fresh.
produces:
- application/json
responses:
"201":
description: Full cycle started in the background
security:
- AdminAuth: []
summary: Trigger a full cycle
tags:
- admin
/-/parse:
post:
description: Kicks off a room-parsing pass and returns 201 immediately. Fire-and-forget,
runs in the background.
produces:
- application/json
responses:
"201":
description: Parsing started in the background
security:
- AdminAuth: []
summary: Trigger parsing
tags:
- admin
/-/reindex:
post:
description: Rebuilds the search index from what is already crawled and returns
201 immediately. Fire-and-forget, runs in the background.
produces:
- application/json
responses:
"201":
description: Reindex started in the background
security:
- AdminAuth: []
summary: Trigger reindex
tags:
- admin
/-/status:
get:
description: 'Full crawler and index statistics: server and room counts, plus
the timing of the last discovery, parsing, and indexing passes. The admin-side
twin of the public /stats, with more detail.'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.IndexStats'
security:
- AdminAuth: []
summary: Index status
tags:
- admin
/.well-known/matrix/client:
get:
description: 'The client well-known: the breadcrumb a Matrix client follows
to find our homeserver base URL, because SRV records never quite caught on
with clients. We only publish m.homeserver; no identity server, we are not
that kind of server.'
produces:
- application/json
responses:
"200":
description: Where a client should point its homeserver base URL
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.WellKnownClient'
summary: Client well-known
tags:
- matrix-cs
/.well-known/matrix/server:
get:
description: 'Our federation delegation, one line: the `m.server` record telling
other homeservers "do not knock here, our federation API answers over there."
One redirect the whole federation agrees to honor.'
produces:
- application/json
responses:
"200":
description: Where our federation API actually answers
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.WellKnownServer'
summary: Server well-known
tags:
- matrix-s2s
/.well-known/matrix/support:
get:
description: 'The MSC1929 support well-known: who to yell at when this server
misbehaves, admin and support contacts plus an optional support page. Straight
from config, so if it is empty, someone forgot to fill it in.'
produces:
- application/json
responses:
"200":
description: Admin and support contacts
schema:
$ref: '#/definitions/msc1929.Response'
summary: Support contacts
tags:
- matrix-cs
/_matrix/client/r0/directory/list/room/{room_id}:
get:
description: 'Whether a room is listed in the public directory. MRS only indexes
public rooms, so if we hold the room the answer is "public"; if we have never
crawled it (or it is banned) you get a 404, same as any homeserver would.
This is a search engine, not a speakeasy: there is no "private" to report,
only "we have it" or "we don''t". r0 and v3 share one handler; r0 is the legacy
alias.'
parameters:
- description: Room ID to check
in: path
name: room_id
required: true
type: string
produces:
- application/json
responses:
"200":
description: The room is indexed, and therefore public
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.RoomVisibility'
"404":
description: We have never crawled that room
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.MatrixError'
summary: Room visibility in the directory
tags:
- matrix-cs
/_matrix/client/r0/directory/room/{room_alias}:
get:
description: 'Turns a human-friendly room alias like #coffee:example.com into
the actual room ID plus a list of servers that might know where it lives,
because nobody memorizes a !opaque:id and clients still have to route the
join somewhere. The r0 and v3 paths are the same handler; r0 is the legacy
alias we keep alive for clients that never upgraded.'
parameters:
- description: 'Room alias to resolve, e.g. #room:server'
in: path
name: room_alias
required: true
type: string
produces:
- application/json
responses:
"200":
description: Room ID and the servers that can help you join
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.QueryDirectoryResponse'
"404":
description: We could not resolve that alias
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.MatrixError'
summary: Resolve a room alias (client)
tags:
- matrix-cs
/_matrix/client/unstable/im.nheko.summary/rooms/{room_id_alias}/summary:
get:
description: Room summary (name, topic, member count, join rules) for a room
ID or alias, per MSC3266. We answer this for rooms we have crawled, so it
works even though we are a search index and not the room's homeserver. Registered
at the stable v1 path plus the two unstable im.nheko.summary paths, because
matrix.to and older clients still call those.
parameters:
- description: Room ID or alias to summarize
in: path
name: room_id_alias
required: true
type: string
- description: A server to try for the summary if we do not hold the room locally.
Only the first value is used.
in: query
name: via
type: string
produces:
- application/json
responses:
"200":
description: Room summary
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.RoomDirectoryRoom'
"404":
description: Room not found
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.MatrixError'
summary: Room summary
tags:
- matrix-cs
/_matrix/client/unstable/im.nheko.summary/summary/{room_id_alias}:
get:
description: Room summary (name, topic, member count, join rules) for a room
ID or alias, per MSC3266. We answer this for rooms we have crawled, so it
works even though we are a search index and not the room's homeserver. Registered
at the stable v1 path plus the two unstable im.nheko.summary paths, because
matrix.to and older clients still call those.
parameters:
- description: Room ID or alias to summarize
in: path
name: room_id_alias
required: true
type: string
- description: A server to try for the summary if we do not hold the room locally.
Only the first value is used.
in: query
name: via
type: string
produces:
- application/json
responses:
"200":
description: Room summary
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.RoomDirectoryRoom'
"404":
description: Room not found
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.MatrixError'
summary: Room summary
tags:
- matrix-cs
/_matrix/client/v1/room_summary/{room_id_alias}:
get:
description: Room summary (name, topic, member count, join rules) for a room
ID or alias, per MSC3266. We answer this for rooms we have crawled, so it
works even though we are a search index and not the room's homeserver. Registered
at the stable v1 path plus the two unstable im.nheko.summary paths, because
matrix.to and older clients still call those.
parameters:
- description: Room ID or alias to summarize
in: path
name: room_id_alias
required: true
type: string
- description: A server to try for the summary if we do not hold the room locally.
Only the first value is used.
in: query
name: via
type: string
produces:
- application/json
responses:
"200":
description: Room summary
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.RoomDirectoryRoom'
"404":
description: Room not found
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.MatrixError'
summary: Room summary
tags:
- matrix-cs
/_matrix/client/v3/directory/list/room/{room_id}:
get:
description: 'Whether a room is listed in the public directory. MRS only indexes
public rooms, so if we hold the room the answer is "public"; if we have never
crawled it (or it is banned) you get a 404, same as any homeserver would.
This is a search engine, not a speakeasy: there is no "private" to report,
only "we have it" or "we don''t". r0 and v3 share one handler; r0 is the legacy
alias.'
parameters:
- description: Room ID to check
in: path
name: room_id
required: true
type: string
produces:
- application/json
responses:
"200":
description: The room is indexed, and therefore public
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.RoomVisibility'
"404":
description: We have never crawled that room
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.MatrixError'
summary: Room visibility in the directory
tags:
- matrix-cs
/_matrix/client/v3/directory/room/{room_alias}:
get:
description: 'Turns a human-friendly room alias like #coffee:example.com into
the actual room ID plus a list of servers that might know where it lives,
because nobody memorizes a !opaque:id and clients still have to route the
join somewhere. The r0 and v3 paths are the same handler; r0 is the legacy
alias we keep alive for clients that never upgraded.'
parameters:
- description: 'Room alias to resolve, e.g. #room:server'
in: path
name: room_alias
required: true
type: string
produces:
- application/json
responses:
"200":
description: Room ID and the servers that can help you join
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.QueryDirectoryResponse'
"404":
description: We could not resolve that alias
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.MatrixError'
summary: Resolve a room alias (client)
tags:
- matrix-cs
/_matrix/client/versions:
get:
description: 'The client-server spec versions and unstable features we claim
to speak. Mostly polite fiction: a hardcoded list of versions we do not really
implement, kept only because matrix.to and older clients refuse to talk to
anything that will not recite them. We are a search index wearing a homeserver''s
coat for a handful of read endpoints, not a real homeserver.'
produces:
- application/json
responses:
"200":
description: The spec versions we pretend to support so clients stop sulking
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.ClientVersions'
summary: Client-server versions
tags:
- matrix-cs
/_matrix/federation/v1/publicRooms:
get:
consumes:
- application/json
description: 'Our slice of the federation public-rooms directory: the rooms
we have crawled and indexed. Authenticated federation endpoint, so a missing
or invalid X-Matrix signature is a 401. GET (query params) and POST (JSON
filter body) share one handler, and a malformed POST body is logged then ignored,
so you get the unfiltered listing rather than an error.'
parameters:
- description: Filter and pagination, POST only
in: body
name: request
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.RoomDirectoryRequest'
produces:
- application/json
responses:
"200":
description: Our indexed slice of the public-rooms directory
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.RoomDirectoryResponse'
"401":
description: Federation auth failed (missing or invalid X-Matrix signature)
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.MatrixError'
security:
- FederationAuth: []
summary: Public rooms directory
tags:
- matrix-s2s
post:
consumes:
- application/json
description: 'Our slice of the federation public-rooms directory: the rooms
we have crawled and indexed. Authenticated federation endpoint, so a missing
or invalid X-Matrix signature is a 401. GET (query params) and POST (JSON
filter body) share one handler, and a malformed POST body is logged then ignored,
so you get the unfiltered listing rather than an error.'
parameters:
- description: Filter and pagination, POST only
in: body
name: request
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.RoomDirectoryRequest'
produces:
- application/json
responses:
"200":
description: Our indexed slice of the public-rooms directory
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.RoomDirectoryResponse'
"401":
description: Federation auth failed (missing or invalid X-Matrix signature)
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.MatrixError'
security:
- FederationAuth: []
summary: Public rooms directory
tags:
- matrix-s2s
/_matrix/federation/v1/query/directory:
get:
description: 'Resolves a room alias to a room ID and the servers that can help
you join. This is an authenticated federation endpoint: we check the incoming
X-Matrix signature first, so a missing or bad one is a 401 before any resolution
happens. Past that we pass back whatever status the lookup produced, so a
404 means we genuinely could not resolve it, not that the endpoint is missing.'
parameters:
- description: 'Room alias to resolve, e.g. #room:server'
in: query
name: room_alias
required: true
type: string
produces:
- application/json
responses:
"200":
description: Room ID and the servers that can help you join
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.QueryDirectoryResponse'
"401":
description: Federation auth failed (missing or invalid X-Matrix signature)
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.MatrixError'
"404":
description: Alias could not be resolved
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.MatrixError'
security:
- FederationAuth: []
summary: Resolve a room alias
tags:
- matrix-s2s
/_matrix/federation/v1/version:
get:
description: Our federation server name and build. Static, cached, boring in
the good way. The one endpoint here that has never once caused an incident,
and we would like to keep it that way.
produces:
- application/json
responses:
"200":
description: Server software name and version
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.ServerVersion'
summary: Server version
tags:
- matrix-s2s
/_matrix/key/v2/query:
post:
consumes:
- application/json
description: 'Notary lookup for a batch of servers, each returned verbatim as
its origin signed it. Malformed JSON gets a 400. An empty batch (valid body,
no server_keys) gets a 200 with an empty key set: you asked for nothing, you
got nothing.'
parameters:
- description: Servers and key IDs to look up
in: body
name: request
required: true
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.QueryServerKeysRequest'
- description: Only return keys valid until at least this timestamp (ms). A
malformed value is treated as 0.
in: query
name: minimum_valid_until_ts
type: integer
produces:
- application/json
responses:
"200":
description: Signed server keys, or an empty key set for an empty batch
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.ServerKeysQueryResponse'
"400":
description: Request body is not valid JSON
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.MatrixError'
summary: Batch query server keys
tags:
- matrix-s2s
/_matrix/key/v2/query/{serverName}:
get:
description: Notary lookup of one remote server's signing keys, handed back
verbatim as the server signed them (we do not re-wrap or re-sign). A server
we cannot reach or verify yields an empty key set, not a 5xx tantrum.
parameters:
- description: Server name to look up keys for
in: path
name: serverName
required: true
type: string
- description: Only return keys valid until at least this timestamp (ms). A
malformed value is treated as 0.
in: query
name: minimum_valid_until_ts
type: integer
produces:
- application/json
responses:
"200":
description: Signed server keys, or an empty key set
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.ServerKeysQueryResponse'
summary: Query one server's keys
tags:
- matrix-s2s
/_matrix/key/v2/server:
get:
description: Our own published ed25519 signing keys, signed by us, so federation
can check that the requests we send are actually ours. It is a naive notary.
verify_keys is a map because the spec key set is dynamic, keyed by key ID.
produces:
- application/json
responses:
"200":
description: Our signed public signing keys
schema:
$ref: '#/definitions/github_com_etkecc_mrs_internal_model.ServerKeys'
summary: Our signing keys
tags:
- matrix-s2s
/_matrix/media/r0/thumbnail/{name}/{id}:
get:
description: Serves a media thumbnail. Tries the unauthenticated client-server
media API first (faster), then falls back to the authenticated federation
media API. Streams the image on a hit, or 204 when there is nothing to serve.
Standard Matrix thumbnail query params (width, height, method) are passed
straight through.
parameters:
- description: Media origin server name
in: path
name: name
required: true
type: string
- description: Media ID
in: path
name: id
required: true
type: string
- description: Thumbnail width
in: query
name: width
type: integer
- description: Thumbnail height
in: query
name: height
type: integer
- description: 'Resize method: crop or scale'
in: query
name: method
type: string
produces:
- image/jpeg
- image/png
responses:
"200":
description: Thumbnail image
schema:
type: file
"204":
description: No thumbnail available
summary: Media thumbnail
tags:
- media
/_matrix/media/v3/thumbnail/{name}/{id}:
get: