# UMApi (User, Tenant, Roles APIs)

## getCurrentUser

Get the current login user.​

```
UMApi.getCurrentUser()
```

**Parameters**

```
None
```

**Returns**

```
Map<String, Object>
```

## getCurrentUserId

Get the current user id​&#x20;

```
UMApi.getCurrentUserId()
```

**Parameters**

```
None​
```

**Returns**

```
String
```

## getIdOfCurrentUser

Get the current user id as a number​

```
UMApi.getIdOfCurrentUser()
```

**Parameters**

```
None​
```

**Returns**

```
String
```

## getIdOfCurrentUserAsLong

Get the current user id as a long number.​

```
UMApi.getIdOfCurrentUserAsLong()
```

**Parameters**

```
None​
```

**Returns**

```
long
```

## isNumeric

Check if i string number is numeric.​

```
UMApi.isNumeric(String strNum)
```

**Parameters**

```
strNum:     number
```

**Returns**

result as a boolean​

## switchToPrivilegedMode

The privileged mode has a superuser access and is able to override logged in user to perform an internal workbench operation e.g., database access.​

```
UMApi.switchToPrivilegedMode()
```

**Parameters**

```
none​
```

**Returns**

```
none​
```

## resetPrivilegedMode

Remove the privileged mode ​ thereby restoring everything to normal.

```
UMApi.resetPrivilegedMode()
```

**Parameters**

```
none​
```

**Returns**

```
none​
```

## isPrivilegedMode

Check if privileged mode is active.

```
UMApi.isPrivilegedMode()
```

**Parameters**

```
none​
```

**Returns**

```
result as a boolean​
```

## switchToPrivilegedUserMode

Switch into the privileged user mode.​

```
UMApi.switchToPrivilegedUserMode()
```

**Parameters**

```
none​
```

**Returns**

```
none​
```

## resetPrivilegedUserMode

Reset the privileged user mode.

```
UMApi.resetPrivilegedUserMode()
```

**Parameters**

```
none
```

**Returns**

```
none
```

## isPrivilegedUserMode

Check if privileged user mode is active

```
UMApi.isPrivilegedUserMode()
```

**Parameters**

```
none​
```

**Returns**

```
boolean status​
```

## getCurrentUserTenantId

get current user tenantid

```
UMApi.getCurrentUserTenantId()
```

**Parameters**

```
none​
```

**Returns**

```
long
```

## getTenantId

get tenantid

```
UMApi.getTenantId()
```

**Parameters**

```
none​
```

**Returns**

```
String
```

## getUserByUserId

get user by userid

```
UMApi.getUserByUserId(String userId)
```

**Parameters**

```
userId
```

**Returns**

```
Object
```

## getUser

get user using id

```
UMApi.getUser(String id)
```

**Parameters**

```
id
```

**Returns**

```
Object
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://trillo.gitbook.io/trillo-workbench-java-sdk/user-tenant-roles-apis-umapi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
