# IRPCVaultsAdmin.CheckForOpenSessions

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Administration API](https://developer.m-files.com/APIs/gRPC-API/admin/index.md) > [Vault management](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/index.md)

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

Badges: `Administration API / specialized` `admin` `session` `idempotent`

Checks whether users have open sessions to a vault: succeeds if there are none and fails with a
list of the sessions otherwise.

- **Service:** [Vault management](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/index.md) `MFiles.IRPCVaultsAdmin`
- **gRPC method:** `/MFiles.IRPCVaultsAdmin/CheckForOpenSessions`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/check-for-open-sessions`
- **Request:** [`CheckForOpenSessionsRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/CheckForOpenSessions/index.md#request)
- **Response:** [`CheckForOpenSessionsResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/CheckForOpenSessions/index.md#response)
- **Book and level:** Administration API, specialized
- **Kind:** admin
- **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 the system administrator server role (server right `manage_vaults`).
- Read-only. Call it before [TakeVaultOffline](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/TakeVaultOffline/index.md)
  with `disconnect_users` false, which fails with the same error.
- The error message lists the first 10 open sessions, one per line. Sessions of the server's own
  components and of vault applications are not counted.

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

## Request: CheckForOpenSessionsRequest

> 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 |
|---|---|---|
| `vault` | `string` | The GUID of the vault. |

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

## Response: CheckForOpenSessionsResponse

No fields.

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

## Related methods

- [TakeVaultOffline](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCVaultsAdmin/TakeVaultOffline/index.md): Takes a vault offline: users cannot log in to it until it is brought online again.
