# IRPCLogin.CreateUserSession

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) > [Login and sessions](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/index.md)

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

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

Opens a session that acts as another user of the vault.

- **Service:** [Login and sessions](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/index.md) `MFiles.IRPCLogin`
- **gRPC method:** `/MFiles.IRPCLogin/CreateUserSession`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/create-user-session`
- **Request:** [`CreateUserSessionRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/CreateUserSession/index.md#request)
- **Response:** [`CreateUserSessionResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCLogin/CreateUserSession/index.md#response)
- **Book and level:** Vault API, core
- **Kind:** session
- **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

Used by M-Files server-side components; applications rarely need it. Allowed only for a vault
session of a local Windows administrator logged in on the server computer; all other sessions
get `E_MFILES_ACCESS_DENIED`, including vault administrators. The new session uses a read-only
license.

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

## Request: CreateUserSessionRequest

> 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 |
|---|---|---|
| `user_id` | `int32` | The ID of the user account (in the session's vault) to act as. |

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

## Response: CreateUserSessionResponse

> 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 |
|---|---|---|
| `session_info` | [`SessionInfoServer`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SessionInfoServer/index.md) | The new session. Send its `session_id` in `mfiles-session-id-bin`. |
| `session_info.session_id` | `bytes` | Session ID when the login process has been completed successfully. |
| `session_info.keep_alive_interval_in_seconds` | `uint32` | The number of seconds that can pass between KeepAlive calls before MFServer closes the session. |
| `session_info.user_id` | `int32` | The M-Files Account ID of the logged-in user. |
| `session_info.account_name` | `string` | The M-Files Account name of the logged-in user. |
| `session_info.session_access_rights` | [`SessionAccess`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SessionAccess/index.md) | The access rights of this session. |
| `session_info.session_access_rights.server_access` | [`ServerAccess`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ServerAccess/index.md) | The session's server-level access rights. |
| `session_info.session_access_rights.vault_access` | [`VaultAccess`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.VaultAccess/index.md) | The session's vault-level access rights. |
| `session_info.session_access_rights.object_access` | [`ObjectAccess`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectAccess/index.md) | The session's object-level access rights regardless of object ACLs. |
| `session_info.session_access_rights.object_type_access` | [`ObjectTypeAccess`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.ObjectTypeAccess/index.md) | The session's object type-level access rights regardless of object type ACLs. |
| `session_info.session_access_rights.property_def_access` | [`PropertyDefAccess`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.PropertyDefAccess/index.md) | The session's property definition-level access rights regardless of property definition ACLs. |
| `session_info.substitute_users[]` | repeated [`UserOrUserGroupID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.UserOrUserGroupID/index.md) | The user ID of this session's account, as well as the users for which the user is a substitute. The first ID in the vector is the user ID. Others are the IDs of the users for which the user is a substitute. |
| `session_info.substitute_users[].type` | [`UserType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.UserType/index.md) | User type. Values: `USER_TYPE_UNKNOWN` (0), `USER_TYPE_USER` (1), `USER_TYPE_USER_GROUP` (2), `USER_TYPE_WORKFLOW_STATE_PSEUDO_USER` (3), `USER_TYPE_PROPERTY_BASED_PSEUDO_USER` (4). |
| `session_info.substitute_users[].id` | `int32` | User or user group. |
| `session_info.user_and_group_memberships[]` | repeated [`UserOrUserGroupID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.UserOrUserGroupID/index.md) | The user ID of this session's account, as well as the groups to which the user belongs either directly or indirectly. The first ID in the vector is the user ID. Others are group IDs. |
| `session_info.user_and_group_memberships[].type` | [`UserType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.UserType/index.md) | User type. Values: `USER_TYPE_UNKNOWN` (0), `USER_TYPE_USER` (1), `USER_TYPE_USER_GROUP` (2), `USER_TYPE_WORKFLOW_STATE_PSEUDO_USER` (3), `USER_TYPE_PROPERTY_BASED_PSEUDO_USER` (4). |
| `session_info.user_and_group_memberships[].id` | `int32` | User or user group. |
| `session_info.is_internal_user` | `bool` | Is the user an internal user? |
| `session_info.use_strict_set_equality_comparison` | `bool` | If false, not equal type comparisons are performed in pre-MF11 style in which it is enough that at least one of the left-side values does not match any of the right-side values in order to treat the left and right values unequal. If true, none of the left-side values can match any of the right-side values in order to treat the left and right values unequal i.e. pure set-based exclusion. Prefer using the new comparison style. The old behavior is provided for compatibility reasons. |
| `session_info.product_mode` | [`ProductMode`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ProductMode/index.md) | Product mode. Values: `PRODUCT_MODE_FULL` (0), `PRODUCT_MODE_EXPRESS` (1), `PRODUCT_MODE_BUSINESS` (2). |
| `session_info.language` | [`Language`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.Language/index.md) | The user's language in the vault. The code and the name may be empty. |
| `session_info.language.id` | `int32` | Language ID. |
| `session_info.language.name` | `string` | The name of the language. |
| `session_info.language.language_code` | `string` | Language indentifier, e.g. the ISO 639-1 or ISO 639-2 language code such as "en" or "eng". |
| `session_info.timezone` | `bytes` | The serialized time zone information (TIME_ZONE_INFORMATION) of this session. |
| `session_info.client_culture` | `string` | The client software culture for this session. |
| `session_info.acl_mode` | [`ACLMode`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ACLMode/index.md) | The ACL mode of the vault. Ignore it for a session that is not a vault session. Values: `ACLMODE_SIMPLE` (0), `ACLMODE_COMPONENT_BASED` (1). |
| `session_info.license_type` | [`LicenseType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.LicenseType/index.md) | The license type of the logged-in user. Values: `LICENSE_TYPE_NONE` (0), `LICENSE_TYPE_NAMED_USER_LICENSE` (1), `LICENSE_TYPE_CONCURRENT_USER_LICENSE` (2), `LICENSE_TYPE_READ_ONLY_LICENSE` (3), `LICENSE_TYPE_VISITOR_LICENSE` (4). |
| `session_info.keep_upload_session_alive_interval_in_seconds` | `uint32` | Keep a file upload session alive at least this often. |
