2020-03-27 13:16:43 -06:00
|
|
|
# Edit Room Membership API
|
|
|
|
|
2024-04-26 12:10:45 -06:00
|
|
|
This API allows an administrator to join a user account with a given `user_id`
|
2020-03-27 13:16:43 -06:00
|
|
|
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.
|
|
|
|
|
2022-01-31 09:24:29 -07:00
|
|
|
To use it, you will need to authenticate by providing an `access_token`
|
2023-01-05 11:18:00 -07:00
|
|
|
for a server admin: see [Admin API](../usage/administration/admin_api/).
|
2022-01-31 09:24:29 -07:00
|
|
|
|
2020-03-27 13:16:43 -06:00
|
|
|
## 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"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Response:
|
|
|
|
|
2021-11-01 05:35:55 -06:00
|
|
|
```json
|
2020-03-27 13:16:43 -06:00
|
|
|
{
|
|
|
|
"room_id": "!636q39766251:server.com"
|
|
|
|
}
|
|
|
|
```
|