# IRPCVaults.GetVaults

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) > [Vaults on a server](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaults/index.md)

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

Badges: `Vault API / core` `read` `session` `idempotent`

Lists the vaults on the server that the session's user can see.

- **Service:** [Vaults on a server](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaults/index.md) `MFiles.IRPCVaults`
- **gRPC method:** `/MFiles.IRPCVaults/GetVaults`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/get-vaults`
- **Request:** [`GetVaultsRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaults/GetVaults/index.md#request)
- **Response:** [`GetVaultsResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaults/GetVaults/index.md#response)
- **Book and level:** Vault API, core
- **Kind:** read
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** yes
- **Returns metadata structure version:** no
- **Streaming:** none (unary)

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

## Remarks

Requires a session, either server-level or vault-level; without one the call fails with
`UNAUTHENTICATED`.

Which vaults are returned:

- A user who can manage vaults on the server sees every vault, unless
  `exclude_vaults_user_cannot_access` is true.
- Any other user sees only vaults where the login account has a user account. With
  `exclude_vaults_user_cannot_access` the user account must also be allowed to log in.
- A user whose login account lives in one vault (vault login accounts) sees only that vault.
- Offline vaults are left out unless `include_offline_vaults` is true.

`vaults` and `online_states` are parallel arrays: `online_states[i]` is the state of `vaults[i]`.

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

## Request: GetVaultsRequest

A structure that specifies get vaults request.

> 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 |
|---|---|---|
| `include_offline_vaults` | `bool` | True to also return vaults that are offline. Default false: only online vaults. |
| `exclude_vaults_user_cannot_access` | `bool` | True to return only vaults the user can log in to. Without it a non-administrator also sees vaults where the user account exists but cannot log in, and a user who manages vaults sees all vaults. |

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

## Response: GetVaultsResponse

A structure that specifies get vaults response.

> 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 |
|---|---|---|
| `vaults[]` | repeated [`VaultBasic`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.VaultBasic/index.md) | The visible vaults. `guid` is the value to pass in `LoginData.vault_guid`. |
| `vaults[].guid` | `string` | The vault GUID, in braces and upper case. Use it as `LoginData.vault_guid`. |
| `vaults[].display_name` | `string` | The vault name shown to users. |
| `vaults[].tooltip` | `string` | Optional description. Often empty. |
| `vaults[].icon` | `bytes` | The vault icon in .ico format, or empty. |
| `vaults[].dns_names` | [`StringArray`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.StringArray/index.md) | Host names configured for the vault, if any. |
| `vaults[].dns_names.value[]` | repeated `string` | String values. |
| `online_states[]` | repeated `bool` | True if the vault at the same index in `vaults` is online. |
