> For the complete documentation index, see [llms.txt](https://trillo.gitbook.io/trillo-workbench-java-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trillo.gitbook.io/trillo-workbench-java-sdk/user-tenant-roles-apis-umapi.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
