diff options
author | Will Hunt <will@half-shot.uk> | 2021-08-17 10:52:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-17 10:52:38 +0100 |
commit | a933c2c7d8ef49c3c98ef443d959f955600bfb6b (patch) | |
tree | 3d7709e1ec13fe7fa49838bb72299c782f675fc4 /docs/admin_api/user_admin_api.md | |
parent | Manhole: wrap coroutines in `defer.ensureDeferred` automatically (#10602) (diff) | |
download | synapse-a933c2c7d8ef49c3c98ef443d959f955600bfb6b.tar.xz |
Add an admin API to check if a username is available (#10578)
This adds a new API GET /_synapse/admin/v1/username_available?username=foo to check if a username is available. It is the counterpart to https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-register-available, except that it works even if registration is disabled.
Diffstat (limited to 'docs/admin_api/user_admin_api.md')
-rw-r--r-- | docs/admin_api/user_admin_api.md | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/admin_api/user_admin_api.md b/docs/admin_api/user_admin_api.md index 33811f5bbb..4b5dd4685a 100644 --- a/docs/admin_api/user_admin_api.md +++ b/docs/admin_api/user_admin_api.md @@ -1057,3 +1057,23 @@ The following parameters should be set in the URL: - `user_id` - The fully qualified MXID: for example, `@user:server.com`. The user must be local. + +### Check username availability + +Checks to see if a username is available, and valid, for the server. See [the client-server +API](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-register-available) +for more information. + +This endpoint will work even if registration is disabled on the server, unlike +`/_matrix/client/r0/register/available`. + +The API is: + +``` +POST /_synapse/admin/v1/username_availabile?username=$localpart +``` + +The request and response format is the same as the [/_matrix/client/r0/register/available](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-register-available) API. + +To use it, you will need to authenticate by providing an `access_token` for a +server admin: [Admin API](../usage/administration/admin_api) |