# IRPCSubstituteUsers.GetUsersBySubstituteUser

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) > [Substitute users](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSubstituteUsers/index.md)

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

Badges: `Vault API / standard` `read` `session` `idempotent` `returns metadata structure version`

Gets the users for whom a given user is a substitute, directly or through group membership
(administration).

- **Service:** [Substitute users](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSubstituteUsers/index.md) `MFiles.IRPCSubstituteUsers`
- **gRPC method:** `/MFiles.IRPCSubstituteUsers/GetUsersBySubstituteUser`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/get-users-by-substitute-user`
- **Request:** [`GetUsersBySubstituteUserRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSubstituteUsers/GetUsersBySubstituteUser/index.md#request)
- **Response:** [`GetUsersBySubstituteUserResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSubstituteUsers/GetUsersBySubstituteUser/index.md#response)
- **Book and level:** Vault API, standard
- **Kind:** read
- **Session:** Required: the session ID from LogIn in the mfiles-session-id-bin metadata.
- **Idempotent:** yes
- **Returns metadata structure version:** yes (in the mfiles-metadata-version-bin trailer)
- **Streaming:** none (unary)

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

## Remarks

- Requires the vault right `manage_users`; other users get "Access denied.".
- A user is returned when the given user, or any group that the given user belongs to directly
  or indirectly, is among that user's substitutes. The given user is never returned.
- Pass the ID of an existing user.

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

## Request: GetUsersBySubstituteUserRequest

> 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 substitute user. |

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

## Response: GetUsersBySubstituteUserResponse

> 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 [`UserOrUserGroupID`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.UserOrUserGroupID/index.md) | The users (`USER_TYPE_USER`) for whom `user_id` is a 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). |
| `users[].id` | `int32` | User or user group. |
