2020-03-27 13:16:43 -06:00
|
|
|
# Edit Room Membership API
|
|
|
|
|
|
|
|
This API allows an administrator to join an user account with a given `user_id`
|
|
|
|
to a room with a given `room_id_or_alias`. You can only modify the membership of
|
|
|
|
local users. The server administrator must be in the room and have permission to
|
|
|
|
invite users.
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
The following parameters are available:
|
|
|
|
|
|
|
|
* `user_id` - Fully qualified user: for example, `@user:server.com`.
|
|
|
|
* `room_id_or_alias` - The room identifier or alias to join: for example,
|
|
|
|
`!636q39766251:server.com`.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```
|
|
|
|
POST /_synapse/admin/v1/join/<room_id_or_alias>
|
|
|
|
|
|
|
|
{
|
|
|
|
"user_id": "@user:server.com"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-06-05 10:31:05 -06:00
|
|
|
To use it, you will need to authenticate by providing an `access_token` for a
|
2021-06-16 06:15:52 -06:00
|
|
|
server admin: see [Admin API](../usage/administration/admin_api).
|
2020-03-27 13:16:43 -06:00
|
|
|
|
|
|
|
Response:
|
|
|
|
|
|
|
|
```
|
|
|
|
{
|
|
|
|
"room_id": "!636q39766251:server.com"
|
|
|
|
}
|
|
|
|
```
|