Add Users
Adds user data to the import staging area. It requires the current import operation state to be either new
or ready
. If successful, it changes the operation state to ready
.
It requires the run-import
permission.
URL | Requires Auth | HTTP Method |
---|---|---|
|
|
|
Headers
Argument | Example | Required | Description |
---|---|---|---|
|
| Required | The authenticated user ID. |
|
| Required | Auth token. |
Payload
Argument | Required | Description |
---|---|---|
|
| An array of user objects. |
User Object
Attribute | Type | Required | Example | Description |
---|---|---|---|---|
| String | Optional | "john.doe" | The user's username. |
| String Array | Required | The user's email addresses. | |
| String Array | Required | ["1523"] | A list of IDs that can identify the user. |
| String | Optional | "John Doe" | The user's display name. |
| Number | Optional | -3 | The user's timezone, in number of hours relative to UTC. |
| String Array | Optional | ["user"] | A list of roles to assign to the user |
| String | Optional | "user" | The user type, must be either "user" or "bot". |
| String | Optional | The user's profile bio. | |
| String | Optional | "P@ssw0rd" | A password to assign to this user. |
| Boolean | Optional | false | Was the user deleted from the previous system? |
| String | Optional | A URL pointing to the user's avatar picture. |
Example Payload
Example Call
Here are some key points to note:
A minimum of one email address and one Import Id is required. If any user is missing those, the endpoint will fail and no user will be added to the operation.
Emails and usernames will not be validated, but they must be unique or the user creation will fail.
If roles are added, they must be valid Rocket.Chat roles, or the endpoint will fail and no user will be added to the operation.
The default roles will be added to all users automatically.
If no password is added, a temporary random password will be generated automatically.
Users flagged as
deleted
will be created as Deactivated on Rocket.Chat.Avatar URLs will not be fetched automatically. The workspace administrator uses the "Download Pending Avatars" button in Administration > Workspace > Import on the workspace after the import is completed.
Import Ids will not be used as Ids by Rocket.Chat, but you can query users by their import id with the
users.info
endpoint.
Example Result
Success
Error
No Permission: This occurs when the authenticated user doesn't have the
run-import
permission.Initialize Import: This occurs when there is no current import operation. See New Import to create a new import operation.
Change Log
Version | Description |
---|---|
| Added |
Last updated