1
0

Add a new admin API to create a new device for a user. (#15611)

This allows an external service (e.g. the matrix-authentication-service)
to create devices for users.
This commit is contained in:
Quentin Gliech
2023-05-17 16:39:06 +02:00
committed by GitHub
parent 4ee82c0576
commit 41b9def9f2
3 changed files with 57 additions and 0 deletions

View File

@@ -813,6 +813,33 @@ The following fields are returned in the JSON response body:
- `total` - Total number of user's devices.
### Create a device
Creates a new device for a specific `user_id` and `device_id`. Does nothing if the `device_id`
exists already.
The API is:
```
POST /_synapse/admin/v2/users/<user_id>/devices
{
"device_id": "QBUAZIFURK"
}
```
An empty JSON dict is returned.
**Parameters**
The following parameters should be set in the URL:
- `user_id` - fully qualified: for example, `@user:server.com`.
The following fields are required in the JSON request body:
- `device_id` - The device ID to create.
### Delete multiple devices
Deletes the given devices for a specific `user_id`, and invalidates
any access token associated with them.