> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Users

Get a list of users with optional filtering.

**Required Permissions**: `manage_system` or an active session and membership in the team or channel.

<Note>
  External Documentation

  To learn more, visit the [Mattermost documentation](https://developers.mattermost.com/api-documentation/#/operations/GetUsers).
</Note>

## Basic Parameters

<div className="integrations-table">
  | Parameter           | Description                                                                                                                                                                                                                                                                                                                                                    |
  | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Channel ID          | The ID of a channel to filter users in a specific channel.                                                                                                                                                                                                                                                                                                     |
  | Filter Active Users | Select to return active or inactive users only.                                                                                                                                                                                                                                                                                                                |
  | Group ID            | The ID of a group to filter users by. Requires `manage_system` permission.                                                                                                                                                                                                                                                                                     |
  | Page                | The page number to retrieve, starting at `0`.                                                                                                                                                                                                                                                                                                                  |
  | Per Page            | The maximum number of items to retrieve per page.                                                                                                                                                                                                                                                                                                              |
  | Return All Pages    | Automatically fetch all resources, page by page.                                                                                                                                                                                                                                                                                                               |
  | Sort                | The field to sort users by. <br /><br />To sort by `last_activity_at` or `create_at` a `Team ID` is required. To sort by `status` a `Channel ID` is required. To sort by `display_name` a `Group ID` is required.<br /><br />For more information, see [sort parameter explanation](https://developers.mattermost.com/api-documentation/#/operations/GetUsers) |
  | Team ID             | The ID of a team to filter users in a specific team.                                                                                                                                                                                                                                                                                                           |
</div>

## Advanced Parameters

<div className="integrations-table">
  | Parameter         | Description                                                                                                                                                                                                                     |
  | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | ABAC Match Only   | Select to restrict results to users whose attributes satisfy the channel's Attribute-Based Access Control (ABAC) membership policy.                                                                                             |
  | Channel Roles     | A comma-separated list of channel roles to filter users by. Must be used with the `In Channel` parameter.                                                                                                                       |
  | Group Constrained | Select to return only users allowed to join the channel or team based on group constraints. Use with `Not In Channel` or `Not In Team`.                                                                                         |
  | Not In Channel    | The ID of a channel to exclude members from the results. Must be used with the `In Channel` parameter.                                                                                                                          |
  | Not In Team       | The ID of a team to exclude users from. Cannot be used with the `In Team` parameter.                                                                                                                                            |
  | Role              | The role to filter results by.                                                                                                                                                                                                  |
  | Roles             | A comma-separated list of system roles to filter users by. Returns users that match any of the specified roles.<br /><br />For example: `system_admin,system_user` returns users that are either system admins or system users. |
  | Team Roles        | A comma-separated list of team roles to filter users by. Must be used with the `In Team` parameter.<br /><br />For example: `team_user` returns users that are only team users and not admins or guests.                        |
  | Without Team      | Select to return only users that are not on any team. Takes precedence over `In Team`, `In Channel`, and `Not In Channel`.                                                                                                      |
</div>

## Example Output

```json theme={"dark"}
[
	{
		"id": "string",
		"create_at": 0,
		"update_at": 0,
		"delete_at": 0,
		"username": "string",
		"first_name": "string",
		"last_name": "string",
		"nickname": "string",
		"email": "string",
		"email_verified": true,
		"auth_service": "string",
		"roles": "string",
		"locale": "string",
		"notify_props": {
			"email": "string",
			"push": "string",
			"desktop": "string",
			"desktop_sound": "string",
			"mention_keys": "string",
			"channel": "string",
			"first_name": "string",
			"auto_responder_message": "string",
			"push_threads": "string",
			"comments": "string",
			"desktop_threads": "string",
			"email_threads": "string"
		},
		"props": {},
		"last_password_update": 0,
		"last_picture_update": 0,
		"failed_attempts": 0,
		"mfa_active": true,
		"timezone": {
			"useAutomaticTimezone": "string",
			"manualTimezone": "string",
			"automaticTimezone": "string"
		},
		"terms_of_service_id": "string",
		"terms_of_service_create_at": 0
	}
]
```

## Workflow Library Example

[List Users with Mattermost and Send Results Via Email](https://library.blinkops.com/workflows/list-users-with-mattermost-and-send-results-via-email)

<div className="iframe-wrapper">
  <div className="iframe-media">
    <img src="https://mintcdn.com/blinkops-2/ojHYuDeYX5FWuN8a/img/Icons/play-box.svg?fit=max&auto=format&n=ojHYuDeYX5FWuN8a&q=85&s=b8af968e71438a9499c3223c9bd29fb2" alt="Workflow Library" width="16" height="16" data-path="img/Icons/play-box.svg" />

    Preview this Workflow on desktop
  </div>

  <iframe className="iframe" src="https://library.blinkops.com/workflows/list-users-with-mattermost-and-send-results-via-email/canvas" />
</div>
