Files
matrix-authentication-service/docs/reference/cli/manage.md
T
Devon HudsonandClaude Opus 5 4ad436fb33 Add a POST /api/admin/v1/room-invites admin endpoint
Mints a single-use, passwordless registration token per recipient, pinned to
their address and optionally to a username, and schedules the invite emails.
The links are only ever mailed to the recipients, so the response carries a
count rather than the tokens.

Minting moves out of the queue and into the caller so a username that is
already taken is refused up front, rather than emailed out as a link nobody
can register with. That leaves the fan-out job with nothing to do, so
`SendRoomInviteEmailsJob` goes away and `SendRoomInviteEmailJob` carries the
token: it takes both the address and the invite link from it, which replaces
the `matrix.to` stub and keeps the link and its recipient together.

`manage send-room-invites` and the endpoint share the minting through
`mas_storage::room_invite`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-28 14:22:00 -06:00

4.3 KiB

manage

The MAS CLI provides several subcommands for managing users and configurations

Global options:

  • --config <config>: Path to the configuration file.
  • --help: Print help.

manage add-email

Add an email address to the specified user.

$ mas-cli manage add-email <username> <email>

manage verify-email

[DEPRECATED] Mark an email address as verified.

$ mas-cli manage verify-email <username> <email>

manage promote-admin

Make a user admin.

$ mas-cli manage promote-admin <username>

This doesn't make all the users sessions admin, but rather lets the user request admin access in administration tools.

manage demote-admin

Make a user non-admin.

$ mas-cli manage demote-admin <username>

manage list-admin-users

List all users with admin privileges.

$ mas-cli manage list-admin-users

manage set-password

Set a user password.

Options:

  • --ignore-complexity: Don't enforce that the password provided is above the minimum configured complexity.
$ mas-cli manage set-password <username> <password> --ignore-complexity

manage issue-compatibility-token

Issue a compatibility token for a user.

Arguments:

  • <username>: User for which to issue the token.
  • [device_id]: Device ID to set in the token. If not specified, a random device ID will be generated.

Options:

  • --yes-i-want-to-grant-synapse-admin-privileges: Whether the token should be given admin privileges.
$ mas-cli manage issue-compatibility-token <username> <device_id> --yes-i-want-to-grant-synapse-admin-privileges

manage issue-user-registration-token

Create a new user registration token.

Options:

  • --token <token>: Specific token string to use. If not provided, a random token will be generated.
  • --usage-limit <usage_limit>: Limit the number of times the token can be used. If not provided, the token can be can be used only once, unless the --unlimited flag is set.
  • --unlimited Allow the token to be used an unlimited number of times.
  • --expires-in <expires_in>: Time in seconds after which the token expires. If not provided, the token never expires.
$ mas-cli manage issue-user-registration-token --token <token> --usage-limit <usage_limit> --expires-in <expires_in>

manage provision-all-users

Trigger a provisioning job for all users.

$ mas-cli manage provision-all-users

manage kill-sessions

Kill all sessions for a user.

Options:

  • --dry-run: Do a dry run, ie see which sessions would be killed.
$ mas-cli manage kill-sessions <username> --dry-run

manage lock-user

Lock a user.

Options:

  • --deactivate: Whether to deactivate the user.
$ mas-cli manage lock-user <username> --deactivate

manage unlock-user

Unlock a user.

Options:

  • --reactivate: Whether to reactivate the user.
$ mas-cli manage unlock-user <username> --reactivate

manage register-user

Register a user. This will interactively prompt for the user's attributes unless the --yes flag is set. It bypasses any policy check on the password, email, etc.

Arguments:

  • [username]: Username to register. Required when using --yes.

Options:

  • --password <password>: Password to set.
  • --email <email>: Email to add. Can be specified multiple times.
  • --upstream-provider-mapping <UPSTREAM_PROVIDER_ID:SUBJECT>: Upstream OAuth 2.0 provider mapping. Can be specified multiple times.
  • --admin: Make the user an admin.
  • --no-admin: Make the user not an admin.
  • --yes: Don't ask questions, just do it.
  • --display-name <display_name>: Set the user's display name.
  • --ignore-password-complexity: Don't enforce that the password provided is above the minimum configured complexity.
$ mas-cli manage register-user
$ mas-cli manage register-user --yes <username>

manage send-room-invites

Send a room invite email to a list of addresses. Each address gets a single-use, passwordless registration token pinned to it, and a link to register with it. This schedules the emails; a worker must be running to actually send them.

Arguments:

  • <room_id>: The room to invite the recipients to.
  • <emails>...: The addresses to invite. At least one is required.
$ mas-cli manage send-room-invites '!room:example.com' alice@example.com bob@example.com