mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-28 07:00:51 +03:00
0fd6b269d3
### Pull Request Checklist <!-- Please read https://element-hq.github.io/synapse/latest/development/contributing_guide.html before submitting your pull request --> * [X] Pull request is based on the develop branch * [X] Pull request includes a [changelog file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should: - Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.". - Use markdown where necessary, mostly for `code blocks`. - End with either a period (.) or an exclamation mark (!). - Start with a capital letter. - Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry. * [X] [Code style](https://element-hq.github.io/synapse/latest/code_style.html) is correct (run the [linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters))
35 lines
831 B
Markdown
35 lines
831 B
Markdown
# Edit Room Membership API
|
|
|
|
This API allows an administrator to join a 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.
|
|
|
|
To use it, you will need to authenticate by providing an `access_token`
|
|
for a server admin: see [Admin API](../usage/administration/admin_api/).
|
|
|
|
## 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:
|
|
|
|
```json
|
|
{
|
|
"room_id": "!636q39766251:server.com"
|
|
}
|
|
```
|