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
In the Web UI, open the Configuration page and go to the Automation tokens tab.
Click Create Token.
In the New Automation Token dialog, specify the token name in the Client ID field, and set the expiration date for the 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.
On the Profiles page, click the name of the profile you want to edit.
Click in the top right corner of the screen and select Edit profile
Copy the value in the ID field.
POST api/import/users
Parameters of the User object
- sub
String
The OAuth2 subject of the Toolbox Enterprise user.
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 tofalse
, 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.