summary:Create a new mapping from room alias to room ID.
operationId:setRoomAlias
@ -129,7 +129,16 @@ paths:
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.
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.
.. Note::
Servers may choose to update the ``alt_aliases`` for the ``m.room.canonical_alias``
state event in the room when an alias is removed. Servers which choose to update the
canonical alias event are recommended to, in addition to their other relevant permission
checks, delete the alias and return a successful response even if the user does not
have permission to update the ``m.room.canonical_alias`` event.
operationId:deleteRoomAlias
security:
- accessToken:[]
@ -159,3 +168,70 @@ paths:
"$ref": "definitions/errors/error.yaml"
tags:
- Room directory
"/rooms/{roomId}/aliases":
get:
summary:Get a list of local aliases on a given room.
description:|-
Get a list of aliases maintained by the local server for the
given room.
This endpoint can be called by users who are in the room (external
users receive an ``M_FORBIDDEN`` error response). If the room's
``m.room.history_visibility`` maps to ``world_readable``, any
user can call this endpoint.
Servers may choose to implement additional access control checks here,
such as allowing server administrators to view aliases regardless of
membership.
.. Note::
Clients are recommended not to display this list of aliases prominently
as they are not curated, unlike those listed in the ``m.room.canonical_alias``
state event.
operationId:getLocalAliases
security:
- accessToken:[]
parameters:
- in:path
type:string
name:roomId
description:The room ID to find local aliases of.
required:true
x-example:"!abc123:example.org"
responses:
200:
description:|-
The list of local aliases for the room.
examples:
application/json:{
"aliases": [
"#somewhere:example.com",
"#another:example.com",
"#hat_trick:example.com"
]
}
schema:
type:object
properties:
aliases:
type:array
description:The server's local aliases on the room. Can be empty.
items:
type:string
required:['aliases']
403:
description:The user is not permitted to retrieve the list of local aliases for the room.
description: 'This event is sent by a homeserver directly to inform of changes to the list of aliases it knows about for that room. The ``state_key`` for this event is set to the homeserver which owns the room alias. The entire set of known aliases for the room is the union of all the ``m.room.aliases`` events, one for each homeserver. Clients **should** check the validity of any room alias given in this list before presenting it to the user as trusted fact. The lists given by this event should be considered simply as advice on which aliases might exist, for which the client can perform the lookup to confirm whether it receives the correct room ID.'
properties:
content:
properties:
aliases:
description: A list of room aliases.
items:
type: string
type: array
required:
- aliases
type: object
state_key:
description: The homeserver domain which owns these room aliases.
type: string
type:
enum:
- m.room.aliases
type: string
title: Informs the room about what room aliases it has been given.