Import users and permissions via REST API
IDE Services offers a bulk user creation feature that allows you to easily add multiple users and assign their access permissions.
When using IDE Services, you can submit a request with an array of users that need to be added to the IDE Services 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 deactivated on the IDE Services 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 IDE Services Server.
Create an automation token
In the Web UI, open the Configuration page and navigate to the Automation Tokens tab.
Click Create Automation Token.
In the Create Automation Token dialog, specify the token name and set its expiration date. Click Create.
Get a profile ID
The current implementation implies that you have profiles created on the IDE Services 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 OAuth 2.0 subject of the IDE Services user.
String
The email of the IDE Services user.
- username
String
The name of the IDE Services user.
- active
Boolean
Defines the status of the current user. If set to
true
, IDE Services 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, IDE Services will generate it automatically and name it according to the ID value.