# UserAccount

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Reference](https://developer.m-files.com/APIs/gRPC-API/Reference/index.md) > [Messages](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.UserAccount/

Struct for a user account in a vault.

- **Full name:** `MFiles.UserAccount`
- **Proto file:** [`mfiles/structs.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/structs.proto)

<a id="fields"></a>

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-id"></a>`id` | `int32` | 1 | The ID of the user account. |
| <a id="f-login_name"></a>`login_name` | `string` | 2 | The login name that is associated with this user account (e.g. 'DOMAIN\user'). |
| <a id="f-vault_roles"></a>`vault_roles` | [`VAULTROLES`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.VAULTROLES/index.md) | 3 | Bitmask of the vault roles of the user. |
| <a id="f-acl"></a>`acl` | [`AccessControlList`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.AccessControlList/index.md) | 4 | Permissions. |
| <a id="f-user_language"></a>`user_language` | `int32` | 5 | The vault language of the user. |
| <a id="f-external_id"></a>`external_id` | `string` | 6 | The user identity in external system, such as Microsoft Entra (where the identity is a GUID). Read-only. |

<a id="used-by-methods"></a>

## Used by methods

- [IRPCUsersAdmin.AddOrUndeleteUser](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCUsersAdmin/AddOrUndeleteUser/index.md): Adds a user account, or brings back a removed one with the same login name.
- [IRPCUsersAdmin.AddOrUndeleteUserViaADSync](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCUsersAdmin/AddOrUndeleteUserViaADSync/index.md): Adds a user account during a directory import; brings back a removed account only when the vault allows that.
- [IRPCUsersAdmin.AddUser](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCUsersAdmin/AddUser/index.md): Adds a user account to the vault, or brings back a removed one.
- [IRPCUsersAdmin.GetChangedUserAccounts](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCUsersAdmin/GetChangedUserAccounts/index.md): Gets the user accounts that were added, changed or removed after a version token.
- [IRPCUsersAdmin.GetUser](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCUsersAdmin/GetUser/index.md): Gets one user account by ID.
- [IRPCUsersAdmin.GetUsers](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCUsersAdmin/GetUsers/index.md): Gets all user accounts of the vault.
- [IRPCUsersAdmin.ModifyUser](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCUsersAdmin/ModifyUser/index.md): Replaces the data of an existing user account.
- [IRPCUsersAdmin.SearchForUser](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCUsersAdmin/SearchForUser/index.md): Finds the user account of a login name.
- [IRPCUsersAdmin.UndeleteUserByGUID](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCUsersAdmin/UndeleteUserByGUID/index.md): Brings back a removed user account, identified by its GUID in the Users value list.
- [IRPCViewsAdmin.GetViewsAndUsersAdmin](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCViewsAdmin/GetViewsAndUsersAdmin/index.md): Gets all common views and the private views of all users, with the owner of each private view.

<a id="used-in-fields"></a>

## Used in fields

- [`GetUsersResponse.results`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCUsersAdmin/GetUsers/index.md#response): All user accounts. See [UserAccount](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.UserAccount/index.md).
- [`ModifyUserRequest.user_account`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCUsersAdmin/ModifyUser/index.md#request): The complete new data of the account; `id` identifies the account to modify.
- [`AddOrUndeleteUserRequest.user_account`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCUsersAdmin/AddOrUndeleteUser/index.md#request): The new account. `login_name` is required; `id` is ignored. A removed user with the same login name is brought back with its old ID.
- [`AddOrUndeleteUserViaADSyncRequest.user_account`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCUsersAdmin/AddOrUndeleteUserViaADSync/index.md#request): The new account. `login_name` is required; `id` is ignored.
- [`GetUserResponse.putf8szua`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCUsersAdmin/GetUser/index.md#response): The user account. See [UserAccount](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.UserAccount/index.md).
- [`SearchForUserResponse.results`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCUsersAdmin/SearchForUser/index.md#response): The matching user account, or empty.
- [`UndeleteUserByGUIDRequest.user_account_data`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCUsersAdmin/UndeleteUserByGUID/index.md#request): The data to store in the restored account (`login_name`, vault roles, ...). `id` is ignored.
- [`AddUserRequest.user_account`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCUsersAdmin/AddUser/index.md#request): The new account: `login_name`, `vault_roles`, and optionally `acl` and `user_language`. `id` is ignored.
- [`GetChangedUserAccountsResponse.new_and_modified`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCUsersAdmin/GetChangedUserAccounts/index.md#response): Accounts added or changed after `version_token`.
- [`GetViewsAndUsersAdminResponse.user_accounts`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCViewsAdmin/GetViewsAndUsersAdmin/index.md#response): The owner of each private view, in the order of `user_defined_views`.
