# IRPCVault.GetUsersAndUserContainers

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Vault API](https://developer.m-files.com/APIs/gRPC-API/vault/index.md) > [Vault information](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/index.md)

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

Badges: `Vault API / core` `read` `session or assertion` `idempotent` `returns metadata structure version`

Gets all users and all user groups of the vault.

- **Service:** [Vault information](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/index.md) `MFiles.IRPCVault`
- **gRPC method:** `/MFiles.IRPCVault/GetUsersAndUserContainers`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/get-users-and-user-containers`
- **Request:** [`GetUsersAndUserContainersRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/GetUsersAndUserContainers/index.md#request)
- **Response:** [`GetUsersAndUserContainersResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/GetUsersAndUserContainers/index.md#response)
- **Book and level:** Vault API, core
- **Kind:** read
- **Session:** Required: a session (mfiles-session-id-bin metadata) or a session assertion (x-mf-session-assertion metadata).
- **Idempotent:** yes
- **Returns metadata structure version:** yes (in the mfiles-metadata-version-bin trailer)
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

The typed way to list users and groups. `users` gives each user's ID (`key`) and full name;
`groups` gives each group with its members (user IDs and group IDs). Includes groups of all
types, unlike [GetUserGroups](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/GetUserGroups/index.md).

<a id="request"></a>

## Request: GetUsersAndUserContainersRequest

No fields.

<a id="response"></a>

## Response: GetUsersAndUserContainersResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `users[]` | repeated [`KeyNamePair`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.KeyNamePair/index.md) | The users: `key` is the user ID, `name` the full name. |
| `users[].key` | `int32` | The unique key of the item. |
| `users[].name` | `string` | The display name of the item. |
| `groups[]` | repeated [`UserGroupBasic`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.UserGroupBasic/index.md) | The user groups with their members. |
| `groups[].id` | `int32` | The ID of the user group. |
| `groups[].name` | `string` | The name of the group. |
| `groups[].members[]` | repeated `int32` | The IDs of the members of this group (user accounts and/or user groups). |
| `groups[].type` | [`UserGroupType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.UserGroupType/index.md) | User group type. Values: `USER_GROUP_TYPE_NORMAL` (0), `USER_GROUP_TYPE_REPOSITORY_USER` (1), `USER_GROUP_TYPE_REPOSITORY_GROUP` (2), `USER_GROUP_TYPE_ANY` (-1). |

<a id="related"></a>

## Related methods

- [GetUserGroups](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/GetUserGroups/index.md): Gets the vault's normal user groups with their members.
- [GetUsersAndUserContainersOrDelta](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVault/GetUsersAndUserContainersOrDelta/index.md): Gets users and user groups of all types as JSON, or only the changes since a version the caller already has.
