Toolbox Enterprise Preview.9 Help

Import users and permissions via REST API

Toolbox Enterprise offers a bulk user creation feature that allows you to easily add multiple users and assign their access permissions.

When using Toolbox Enterprise, you can submit a request with an array of users that need to be added to the Toolbox Enterprise Server. In the current implementation, the request replaces existing users in the database with the ones specified in the JSON. This means that any user not included in the array will be deleted on the Toolbox Enterprise Server. Additionally, if there are any differences in user permissions or assigned profiles, these details will be overwritten as well.

Generate an automation token

To make a request, you need a valid automation token generated on the Toolbox Enterprise Server.

Create an automation token

  1. In the Web UI, open the Configuration page and go to the Automation tokens tab.

  2. Click Create Token.

  3. In the New Automation Token dialog, specify the token name in the Client ID field, and set the expiration date for the token.

    New automation token

Get a profile ID

The current implementation implies that you have profiles created on the Toolbox Enterprise Server. In the request, you need to provide IDs of those profiles that you want to assign to particular users.

  1. On the Profiles page, click the name of the profile you want to edit.

  2. Click More options in the top right corner of the screen and select Edit profile

  3. Copy the value in the ID field.

    Edit a profile

POST api/import/users

### POST http://localhost:8080/api/import/users Authorization: Bearer {{access_token}} Content-Type: application/json { "users": [ { "sub": "user1", "email": "user1@toolbox.com", "username": "user1", "active": true, "permissions": [ { "id": "ADMIN", "type": "ROLE" } ], "profiles": [ { "id": "80adf6a6-86c6-44f4-8392-a8bef847378e" } ] }, { "sub": "toolbox.admin", "email": "admin@toolbox.com", "username": "toolbox.admin", "active": true, "permissions": [ { "id": "ADMIN", "type": "ROLE" } ], "profiles": [ { "id": "80adf6a6-86c6-44f4-8392-a8bef847378e" } ] } ] }

Parameters of the User object

sub

String

The OAuth2 subject of the Toolbox Enterprise user.

email

String

The email of the Toolbox Enterprise user.

username

String

The name of the Toolbox Enterprise user.

active

Boolean

Defines the status of the current user. If set to true, Toolbox Enterprise will manage the user and consider it as active. If set to false, the current user will be created as deactivated.

permissions

Array of objects

Defines the role assigned to the current user.

Possible values:

  • Administrator:

    { "id": "ADMIN", "type": "ROLE" }
  • Regular user:

    { "id": "USER", "type": "ROLE" }

If both roles are assigned to the user, they will get the administrator role automatically.

profiles

Array of objects

Lists IDs of all profiles that will be automatically assigned to the current user.

If you provide an ID of a profile that doesn't exist yet, Toolbox Enterprise will generate it automatically and name it according to the ID value.

Last modified: 16 April 2024