Module users_api

Source

Enums§

AttachDeviceIdError
struct for typed errors of method attach_device_id
AutocompleteUsersError
struct for typed errors of method autocomplete_users
CheckUserMfaError
struct for typed errors of method check_user_mfa
ConvertBotToUserError
struct for typed errors of method convert_bot_to_user
ConvertUserToBotError
struct for typed errors of method convert_user_to_bot
CreateUserAccessTokenError
struct for typed errors of method create_user_access_token
CreateUserError
struct for typed errors of method create_user
DeleteUserError
struct for typed errors of method delete_user
DemoteUserToGuestError
struct for typed errors of method demote_user_to_guest
DisableUserAccessTokenError
struct for typed errors of method disable_user_access_token
EnableUserAccessTokenError
struct for typed errors of method enable_user_access_token
GenerateMfaSecretError
struct for typed errors of method generate_mfa_secret
GetChannelMembersWithTeamDataForUserError
struct for typed errors of method get_channel_members_with_team_data_for_user
GetDefaultProfileImageError
struct for typed errors of method get_default_profile_image
GetKnownUsersError
struct for typed errors of method get_known_users
GetProfileImageError
struct for typed errors of method get_profile_image
GetSessionsError
struct for typed errors of method get_sessions
GetTotalUsersStatsError
struct for typed errors of method get_total_users_stats
GetTotalUsersStatsFilteredError
struct for typed errors of method get_total_users_stats_filtered
GetUploadsForUserError
struct for typed errors of method get_uploads_for_user
GetUserAccessTokenError
struct for typed errors of method get_user_access_token
GetUserAccessTokensError
struct for typed errors of method get_user_access_tokens
GetUserAccessTokensForUserError
struct for typed errors of method get_user_access_tokens_for_user
GetUserAuditsError
struct for typed errors of method get_user_audits
GetUserByEmailError
struct for typed errors of method get_user_by_email
GetUserByUsernameError
struct for typed errors of method get_user_by_username
GetUserError
struct for typed errors of method get_user
GetUserTermsOfServiceError
struct for typed errors of method get_user_terms_of_service
GetUsersByGroupChannelIdsError
struct for typed errors of method get_users_by_group_channel_ids
GetUsersByIdsError
struct for typed errors of method get_users_by_ids
GetUsersByUsernamesError
struct for typed errors of method get_users_by_usernames
GetUsersError
struct for typed errors of method get_users
LoginByCwsTokenError
struct for typed errors of method login_by_cws_token
LoginError
struct for typed errors of method login
LogoutError
struct for typed errors of method logout
MigrateAuthToLdapError
struct for typed errors of method migrate_auth_to_ldap
MigrateAuthToSamlError
struct for typed errors of method migrate_auth_to_saml
PatchUserError
struct for typed errors of method patch_user
PermanentDeleteAllUsersError
struct for typed errors of method permanent_delete_all_users
PromoteGuestToUserError
struct for typed errors of method promote_guest_to_user
PublishUserTypingError
struct for typed errors of method publish_user_typing
RegisterTermsOfServiceActionError
struct for typed errors of method register_terms_of_service_action
ResetPasswordError
struct for typed errors of method reset_password
RevokeAllSessionsError
struct for typed errors of method revoke_all_sessions
RevokeSessionError
struct for typed errors of method revoke_session
RevokeSessionsFromAllUsersError
struct for typed errors of method revoke_sessions_from_all_users
RevokeUserAccessTokenError
struct for typed errors of method revoke_user_access_token
SearchUserAccessTokensError
struct for typed errors of method search_user_access_tokens
SearchUsersError
struct for typed errors of method search_users
SendPasswordResetEmailError
struct for typed errors of method send_password_reset_email
SendVerificationEmailError
struct for typed errors of method send_verification_email
SetDefaultProfileImageError
struct for typed errors of method set_default_profile_image
SetProfileImageError
struct for typed errors of method set_profile_image
SwitchAccountTypeError
struct for typed errors of method switch_account_type
UpdateUserActiveError
struct for typed errors of method update_user_active
UpdateUserAuthError
struct for typed errors of method update_user_auth
UpdateUserError
struct for typed errors of method update_user
UpdateUserMfaError
struct for typed errors of method update_user_mfa
UpdateUserPasswordError
struct for typed errors of method update_user_password
UpdateUserRolesError
struct for typed errors of method update_user_roles
VerifyUserEmailError
struct for typed errors of method verify_user_email
VerifyUserEmailWithoutTokenError
struct for typed errors of method verify_user_email_without_token

Functions§

attach_device_id
Attach a mobile device id to the currently logged in session. This will enable push notifications for a user, if configured by the server. ##### Permissions Must be authenticated.
autocomplete_users
Get a list of users for the purpose of autocompleting based on the provided search term. Specify a combination of team_id and channel_id to filter results further. ##### Permissions Requires an active session and view_team and read_channel on any teams or channels used to filter the results further.
check_user_mfa
Check if a user has multi-factor authentication active on their account by providing a login id. Used to check whether an MFA code needs to be provided when logging in. ##### Permissions No permission required.
convert_bot_to_user
Convert a bot into a user. Minimum server version: 5.26 ##### Permissions Must have manage_system permission.
convert_user_to_bot
Convert a user into a bot. Minimum server version: 5.26 ##### Permissions Must have manage_system permission.
create_user
Create a new user on the system. Password is required for email login. For other authentication types such as LDAP or SAML, auth_data and auth_service fields are required. ##### Permissions No permission required for creating email/username accounts on an open server. Auth Token is required for other authentication types such as LDAP or SAML.
create_user_access_token
Generate a user access token that can be used to authenticate with the Mattermost REST API. Minimum server version: 4.1 ##### Permissions Must have create_user_access_token permission. For non-self requests, must also have the edit_other_users permission.
delete_user
Deactivates the user and revokes all its sessions by archiving its user object. As of server version 5.28, optionally use the permanent=true query parameter to permanently delete the user for compliance reasons. To use this feature ServiceSettings.EnableAPIUserDeletion must be set to true in the server’s configuration. ##### Permissions Must be logged in as the user being deactivated or have the edit_other_users permission.
demote_user_to_guest
Convert a regular user into a guest. This will convert the user into a guest for the whole system while retaining their existing team and channel memberships. Minimum server version: 5.16 ##### Permissions Must be logged in as the user or have the demote_to_guest permission.
disable_user_access_token
Disable a personal access token and delete any sessions using the token. The token can be re-enabled using /users/tokens/enable. Minimum server version: 4.4 ##### Permissions Must have revoke_user_access_token permission. For non-self requests, must also have the edit_other_users permission.
enable_user_access_token
Re-enable a personal access token that has been disabled. Minimum server version: 4.4 ##### Permissions Must have create_user_access_token permission. For non-self requests, must also have the edit_other_users permission.
generate_mfa_secret
Generates an multi-factor authentication secret for a user and returns it as a string and as base64 encoded QR code image. ##### Permissions Must be logged in as the user or have the edit_other_users permission.
get_channel_members_with_team_data_for_user
Get all channel members from all teams for a user. Minimum server version: 6.2.0 ##### Permissions Logged in as the user, or have edit_other_users permission.
get_default_profile_image
Returns the default (generated) user profile image based on user_id string parameter. ##### Permissions Must be logged in. Minimum server version: 5.5
get_known_users
Get the list of user IDs of users with any direct relationship with a user. That means any user sharing any channel, including direct and group channels. ##### Permissions Must be authenticated. Minimum server version: 5.23
get_profile_image
Get a user’s profile image based on user_id string parameter. ##### Permissions Must be logged in.
get_sessions
Get a list of sessions by providing the user GUID. Sensitive information will be sanitized out. ##### Permissions Must be logged in as the user being updated or have the edit_other_users permission.
get_total_users_stats
Get a total count of users in the system. ##### Permissions Must be authenticated.
get_total_users_stats_filtered
Get a count of users in the system matching the specified filters. Minimum server version: 5.26 ##### Permissions Must have manage_system permission.
get_uploads_for_user
Gets all the upload sessions belonging to a user. Minimum server version: 5.28 ##### Permissions Must be logged in as the user who created the upload sessions.
get_user
Get a user a object. Sensitive information will be sanitized out. ##### Permissions Requires an active session but no other permissions.
get_user_access_token
Get a user access token. Does not include the actual authentication token. Minimum server version: 4.1 ##### Permissions Must have read_user_access_token permission. For non-self requests, must also have the edit_other_users permission.
get_user_access_tokens
Get a page of user access tokens for users on the system. Does not include the actual authentication tokens. Use query parameters for paging. Minimum server version: 4.7 ##### Permissions Must have manage_system permission.
get_user_access_tokens_for_user
Get a list of user access tokens for a user. Does not include the actual authentication tokens. Use query parameters for paging. Minimum server version: 4.1 ##### Permissions Must have read_user_access_token permission. For non-self requests, must also have the edit_other_users permission.
get_user_audits
Get a list of audit by providing the user GUID. ##### Permissions Must be logged in as the user or have the edit_other_users permission.
get_user_by_email
Get a user object by providing a user email. Sensitive information will be sanitized out. ##### Permissions Requires an active session and for the current session to be able to view another user’s email based on the server’s privacy settings.
get_user_by_username
Get a user object by providing a username. Sensitive information will be sanitized out. ##### Permissions Requires an active session but no other permissions.
get_user_terms_of_service
Will be deprecated in v6.0 Fetches user’s latest terms of service action if the latest action was for acceptance. Minimum server version: 5.6 ##### Permissions Must be logged in as the user being acted on.
get_users
Get a page of a list of users. Based on query string parameters, select users from a team, channel, or select users not in a specific channel. Since server version 4.0, some basic sorting is available using the sort query parameter. Sorting is currently only supported when selecting users on a team. ##### Permissions Requires an active session and (if specified) membership to the channel or team being selected from.
get_users_by_group_channel_ids
Get an object containing a key per group channel id in the query and its value as a list of users members of that group channel. The user must be a member of the group ids in the query, or they will be omitted from the response. ##### Permissions Requires an active session but no other permissions. Minimum server version: 5.14
get_users_by_ids
Get a list of users based on a provided list of user ids. ##### Permissions Requires an active session but no other permissions.
get_users_by_usernames
Get a list of users based on a provided list of usernames. ##### Permissions Requires an active session but no other permissions.
login
Permissions No permission required
login_by_cws_token
CWS stands for Customer Web Server which is the cloud service used to manage cloud instances. ##### Permissions A Cloud license is required
logout
Permissions An active session is required
migrate_auth_to_ldap
Migrates accounts from one authentication provider to another. For example, you can upgrade your authentication provider from email to LDAP. Minimum server version: 5.28 ##### Permissions Must have manage_system permission.
migrate_auth_to_saml
Migrates accounts from one authentication provider to another. For example, you can upgrade your authentication provider from email to SAML. Minimum server version: 5.28 ##### Permissions Must have manage_system permission.
patch_user
Partially update a user by providing only the fields you want to update. Omitted fields will not be updated. The fields that can be updated are defined in the request body, all other provided fields will be ignored. ##### Permissions Must be logged in as the user being updated or have the edit_other_users permission.
permanent_delete_all_users
Permanently deletes all users and all their related information, including posts. Minimum server version: 5.26.0 Local mode only: This endpoint is only available through local mode.
promote_guest_to_user
Convert a guest into a regular user. This will convert the guest into a user for the whole system while retaining any team and channel memberships and automatically joining them to the default channels. Minimum server version: 5.16 ##### Permissions Must be logged in as the user or have the promote_guest permission.
publish_user_typing
Notify users in the given channel via websocket that the given user is typing. Minimum server version: 5.26 ##### Permissions Must have manage_system permission to publish for any user other than oneself.
register_terms_of_service_action
Records user action when they accept or decline custom terms of service. Records the action in audit table. Updates user’s last accepted terms of service ID if they accepted it. Minimum server version: 5.4 ##### Permissions Must be logged in as the user being acted on.
reset_password
Update the password for a user using a one-use, timed recovery code tied to the user’s account. Only works for non-SSO users. ##### Permissions No permissions required.
revoke_all_sessions
Revokes all user sessions from the provided user id and session id strings. ##### Permissions Must be logged in as the user being updated or have the edit_other_users permission. Minimum server version: 4.4
revoke_session
Revokes a user session from the provided user id and session id strings. ##### Permissions Must be logged in as the user being updated or have the edit_other_users permission.
revoke_sessions_from_all_users
For any session currently on the server (including admin) it will be revoked. Clients will be notified to log out users. Minimum server version: 5.14 ##### Permissions Must have manage_system permission.
revoke_user_access_token
Revoke a user access token and delete any sessions using the token. Minimum server version: 4.1 ##### Permissions Must have revoke_user_access_token permission. For non-self requests, must also have the edit_other_users permission.
search_user_access_tokens
Get a list of tokens based on search criteria provided in the request body. Searches are done against the token id, user id and username. Minimum server version: 4.7 ##### Permissions Must have manage_system permission.
search_users
Get a list of users based on search criteria provided in the request body. Searches are typically done against username, full name, nickname and email unless otherwise configured by the server. ##### Permissions Requires an active session and read_channel and/or view_team permissions for any channels or teams specified in the request body.
send_password_reset_email
Send an email containing a link for resetting the user’s password. The link will contain a one-use, timed recovery code tied to the user’s account. Only works for non-SSO users. ##### Permissions No permissions required.
send_verification_email
Send an email with a verification link to a user that has an email matching the one in the request body. This endpoint will return success even if the email does not match any users on the system. ##### Permissions No permissions required.
set_default_profile_image
Delete user’s profile image and reset to default image based on user_id string parameter. ##### Permissions Must be logged in as the user being updated or have the edit_other_users permission. Minimum server version: 5.5
set_profile_image
Set a user’s profile image based on user_id string parameter. ##### Permissions Must be logged in as the user being updated or have the edit_other_users permission.
switch_account_type
Switch a user’s login method from using email to OAuth2/SAML/LDAP or back to email. When switching to OAuth2/SAML, account switching is not complete until the user follows the returned link and completes any steps on the OAuth2/SAML service provider. To switch from email to OAuth2/SAML, specify current_service, new_service, email and password. To switch from OAuth2/SAML to email, specify current_service, new_service, email and new_password. To switch from email to LDAP/AD, specify current_service, new_service, email, password, ldap_ip and new_password (this is the user’s LDAP password). To switch from LDAP/AD to email, specify current_service, new_service, ldap_ip, password (this is the user’s LDAP password), email and new_password. Additionally, specify mfa_code when trying to switch an account on LDAP/AD or email that has MFA activated. ##### Permissions No current authentication required except when switching from OAuth2/SAML to email.
update_user
Update a user by providing the user object. The fields that can be updated are defined in the request body, all other provided fields will be ignored. Any fields not included in the request body will be set to null or reverted to default values. ##### Permissions Must be logged in as the user being updated or have the edit_other_users permission.
update_user_active
Update user active or inactive status. Since server version 4.6, users using a SSO provider to login can be activated or deactivated with this endpoint. However, if their activation status in Mattermost does not reflect their status in the SSO provider, the next synchronization or login by that user will reset the activation status to that of their account in the SSO provider. Server versions 4.5 and before do not allow activation or deactivation of SSO users from this endpoint. ##### Permissions User can deactivate themselves. User with manage_system permission can activate or deactivate a user.
update_user_auth
Updates a user’s authentication method. This can be used to change them to/from LDAP authentication for example. Minimum server version: 4.6 ##### Permissions Must have the edit_other_users permission.
update_user_mfa
Activates multi-factor authentication for the user if activate is true and a valid code is provided. If activate is false, then code is not required and multi-factor authentication is disabled for the user. ##### Permissions Must be logged in as the user being updated or have the edit_other_users permission.
update_user_password
Update a user’s password. New password must meet password policy set by server configuration. Current password is required if you’re updating your own password. ##### Permissions Must be logged in as the user the password is being changed for or have manage_system permission.
update_user_roles
Update a user’s system-level roles. Valid user roles are "system_user", "system_admin" or both of them. Overwrites any previously assigned system-level roles. ##### Permissions Must have the manage_roles permission.
verify_user_email
Verify the email used by a user to sign-up their account with. ##### Permissions No permissions required.
verify_user_email_without_token
Verify the email used by a user without a token. Minimum server version: 5.24 ##### Permissions Must have manage_system permission.