---
title: AdminApi
summary: Java SDK: the Admin operations, 3 methods, each with its parameters, result and a complete example.
order: 21
languages: [java]
sdk-package: Java SDK · nl.bimbase.bimworks.sdk
link-terms: true
---

# AdminApi

[[page:reference/sdk/java|Java SDK]] · `nl.bimbase.bimworks.sdk.api` · class · 3 methods

The administration of an organization: its accounts and features

Construct it with the client of [[page:reference/sdk/java#connect|the connect step]]: `new AdminApi(client)`. Each method is one operation of the [[page:api|API part]], where it runs on its page.

<table class="dense">
<thead><tr><th>Method</th><th>Operation</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>[[page:reference/sdk/java/adminapi#listaccountuserfeatures|listAccountUserFeatures]]</code></td><td>[[openapi:ListAccountUserFeatures]]</td><td>The user features of an account</td></tr>
<tr><td><code>[[page:reference/sdk/java/adminapi#listaccounts|listAccounts]]</code></td><td>[[openapi:ListAccounts]]</td><td>List the accounts of the organization</td></tr>
<tr><td><code>[[page:reference/sdk/java/adminapi#listorganizations|listOrganizations]]</code></td><td>[[openapi:ListOrganizations]]</td><td>The caller's organization</td></tr>
</tbody>
</table>

## `listAccountUserFeatures` {#listaccountuserfeatures}

```java
public List<UserFeatureState> listAccountUserFeatures(ListAccountUserFeaturesRequest listAccountUserFeaturesRequest) throws ApiException
```

The user features of an account. Every user feature with whether the account has it: what the account may do in BIM.works. The caller's own account when `account_uuid` is absent; another account's needs SuperAdmin.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:ListAccountUserFeatures]] · <code>POST /openapi/admin/ListAccountUserFeatures</code></td></tr>
<tr><th>Scope</th><td>[[scope:account:read]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>listAccountUserFeaturesRequest</code></td><td><code>[[page:reference/sdk/java/models#ListAccountUserFeaturesRequest|ListAccountUserFeaturesRequest]]</code><span class="opt">optional</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:ListAccountUserFeatures]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>List&lt;[[page:reference/sdk/java/models#UserFeatureState|UserFeatureState]]&gt;</code> — The features, by name

### Example

```java
import nl.bimbase.bimworks.sdk.api.AdminApi;
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.ListAccountUserFeaturesRequest;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        ListAccountUserFeaturesRequest request = client.getObjectMapper().readValue("""
                {
                  "account_uuid": "00000000-0000-0000-0000-000000000000"
                }
                """, ListAccountUserFeaturesRequest.class);

        // 3. The call
        var result = new AdminApi(client).listAccountUserFeatures(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `listAccounts` {#listaccounts}

```java
public List<AccountEntry> listAccounts(ListAccountsRequest listAccountsRequest) throws ApiException
```

List the accounts of the organization. The accounts of the caller's organization, newest first, each with its user and how it signs in. With `include_invites` the open invites follow the accounts. Removed accounts are left out unless `show_deleted`. Only a super admin or the organization's creator lists them, with a session or an API token; for any other member the answer is 403 NON_AUTHORIZED_TASK.

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:ListAccounts]] · <code>POST /openapi/admin/ListAccounts</code></td></tr>
<tr><th>Scope</th><td>[[scope:admin:read]]</td></tr>
</tbody>
</table>

### Parameters

<table class="dense">
<thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>listAccountsRequest</code></td><td><code>[[page:reference/sdk/java/models#ListAccountsRequest|ListAccountsRequest]]</code><span class="opt">optional</span></td><td>The request: its properties are those of the model, its JSON that of [[openapi:ListAccounts]]'s request body.</td></tr>
</tbody>
</table>

### Returns

<code>List&lt;[[page:reference/sdk/java/models#AccountEntry|AccountEntry]]&gt;</code> — The accounts, then the invites

### Example

```java
import nl.bimbase.bimworks.sdk.api.AdminApi;
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.ListAccountsRequest;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        ListAccountsRequest request = client.getObjectMapper().readValue("""
                {
                  "include_invites": false,
                  "show_deleted": false
                }
                """, ListAccountsRequest.class);

        // 3. The call
        var result = new AdminApi(client).listAccounts(request);

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```

## `listOrganizations` {#listorganizations}

```java
public List<Organization> listOrganizations() throws ApiException
```

The caller's organization. The organization of the caller's account (an empty list when it has none).

<table class="dense">
<tbody>
<tr><th>Operation</th><td>[[openapi:ListOrganizations]] · <code>POST /openapi/admin/ListOrganizations</code></td></tr>
<tr><th>Scope</th><td>[[scope:admin:read]]</td></tr>
</tbody>
</table>

### Parameters

None: the operation takes no request.

### Returns

<code>List&lt;[[page:reference/sdk/java/models#Organization|Organization]]&gt;</code> — The organization

### Example

```java
import nl.bimbase.bimworks.sdk.api.AdminApi;
import nl.bimbase.bimworks.sdk.api.AuthApi;
import nl.bimbase.bimworks.sdk.client.ApiClient;
import nl.bimbase.bimworks.sdk.model.Auth;
import nl.bimbase.bimworks.sdk.model.LoginWithApiTokenRequest;

public class Example {
    public static void main(String[] args) throws Exception {
        // 1. Connect to BIM.works and log in with your API token
        ApiClient client = new ApiClient();
        client.updateBaseUri("BIM_WORKS_ADDRESS/openapi");
        Auth auth = new AuthApi(client)
                .loginWithApiToken(new LoginWithApiTokenRequest().token("BIM_WORKS_API_TOKEN"))
                .getAuth();
        client.setRequestInterceptor(builder -> builder.setHeader("Authorization", "Bearer " + auth.getBase64()));

        // 2. The request
        // (ListOrganizations takes no request)

        // 3. The call
        var result = new AdminApi(client).listOrganizations();

        // 4. The result
        System.out.println(client.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(result));
    }
}
```
