User

synadm user

list, add, modify, deactivate/erase users, reset passwords

synadm user [OPTIONS] COMMAND [ARGS]...

deactivate

deactivate or gdpr-erase a user. Provide matrix user ID (@user:server) as argument. It removes active access tokens, resets the password, and deletes third-party IDs (to prevent the user requesting a password reset).

synadm user deactivate [OPTIONS] USER_ID

Options

-e, --gdpr-erase

marks the user as GDPR-erased. This means messages sent by the user will still be visible by anyone that was in the room when these messages were sent, but hidden from users joining the room afterwards.

Default

False

Arguments

USER_ID

Required argument

details

view details of a user account.

synadm user details [OPTIONS] USER_ID

Arguments

USER_ID

Required argument

list

list and search for users

synadm user list [OPTIONS]

Options

-f, --from <from_>

offset user listing by given number. This option is also used for pagination.

Default

0

-l, --limit <limit>

limit user listing to given number

Default

100

-g, --guests, -G, --no-guests

show guest users.

-d, --deactivated

also show deactivated/erased users

Default

False

-n, --name <name>

search users by name - filters to only return users with user ID localparts or displaynames that contain this value (localpart is the left part before the colon of the matrix ID (@user:server)

-i, --user-id <user_id>

search users by ID - filters to only return users with Matrix IDs (@user:server) that contain this value

login

Get an access token for a given user.

Useful for when admins wish to do actions on behalf of a user.

If no –expire* option is given, a default token expiry time of exactly 1 day (24h) is used. If it’s desired that the token never expires, use –expire-never

This API does not generate a new device for the user, and so will not appear in their /devices list, and in general the target user should not be able to tell they have been logged in as.

To expire the token before the expiry date/time is reached, call the standard /logout API with the token. Note: The token will expire if the admin user calls /logout/all from any of their devices, but the token will not expire if the target user does the same.

synadm user login [OPTIONS] USER_ID

Options

-d, --expire-days <expire_days>

expire token after this number of days.

--expire <expire>

expire token after this point in time. Eg. ‘2021-01-01’, see above for available date/time formats.

--expire-ts <expire_ts>

expire token after this point in time giving a unix timestamp in ms.

--expire-never

never expire token.

Default

False

Arguments

USER_ID

Required argument

media

list all local media uploaded by a user. Provide matrix user ID (@user:server) as argument.

Gets a list of all local media that a specific user_id has created. By default, the response is ordered by descending creation date and ascending media ID. The newest media is on top. You can change the order with options –order-by and –reverse.

Caution. The database only has indexes on the columns media_id, user_id and created_ts. This means that if a different sort order is used (upload_name, last_access_ts, media_length, media_type, quarantined_by or safe_from_quarantine), this can cause a large load on the database, especially for large environments

synadm user media [OPTIONS] USER_ID

Options

-f, --from <from_>

offset media listing by given number. This option is also used for pagination.

Default

0

-l, --limit <limit>

limit media listing to given number

Default

100

-s, --sort <sort>

The method by which to sort the returned list of media. If the ordered field has duplicates, the second order is always by ascending media_id, which guarantees a stable ordering.

Options

media_id | upload_name | created_ts | last_access_ts | media_length | media_type | quarantined_by | safe_from_quarantine

-r, --reverse

Direction of media order. If set it will reverse the sort order of –order-by method.

Arguments

USER_ID

Required argument

membership

list all rooms a user is member of. Provide matrix user ID (@user:server) as argument.

synadm user membership [OPTIONS] USER_ID

Arguments

USER_ID

Required argument

modify

create or modify a local user. Provide matrix user ID (@user:server) as argument.

synadm user modify [OPTIONS] USER_ID

Options

-p, --password-prompt

set password interactively.

-P, --password <password>

set password on command line.

-n, --display-name <display_name>

set display name. defaults to the value of user_id

-t, --threepid <threepid>

add a third-party identifier. This can be an email address or a phone number. Threepids are used for several things: For use when logging in, as an alternative to the user id. In the case of email, as an alternative contact to help with account recovery, as well as to receive notifications of missed messages. Format: medium value (eg. –threepid email <user@example.org>). This option can also be stated multiple times, i.e. a user can have multiple threepids configured.

-v, --avatar-url <avatar_url>

set avatar URL. Must be a MXC URI (https://matrix.org/docs/spec/client_server/r0.6.0#matrix-content-mxc-uris)

-a, --admin, -u, --no-admin

grant user admin permission. Eg user is allowed to use the admin API

--activate

re-activate user.

--deactivate

deactivate user. Use with caution! Deactivating a user removes their active access tokens, resets their password, kicks them out of all rooms and deletes third-party identifiers (to prevent the user requesting a password reset). See also “user deactivate” command.

Arguments

USER_ID

Required argument

password

change a user’s password. To prevent the user from being logged out of all sessions use option -n

synadm user password [OPTIONS] USER_ID

Options

-n, --no-logout

don’t log user out of all sessions on all devices.

-p, --password <password>

new password

Arguments

USER_ID

Required argument

whois

Return information about the active sessions for a specific user

synadm user whois [OPTIONS] USER_ID

Arguments

USER_ID

Required argument