Add Users
- Print
- DarkLight
- PDF
Add Users
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Post
/api/v1/import.addUsers
Adds user data to the import staging area. It requires the current import operation status to be either new
or ready
. If successful, it changes the operation state to ready
. Permission required: run-import
Changelog
Version | Description |
---|---|
6.3.0 | Added |
Header parameters
X-User-Id
stringRequired
The user ID.
ExampleCkCPNctrgCDfmWLqC
X-Auth-Token
stringRequired
The authentication token.
Example1Dd4iN_ClKn5jl-xPC36snQ4s9Zd5GZnXCQuCNSKcVE
Body parameters
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 asDeactivated
on Rocket.Chat. - Avatar URLs will not be fetched automatically. The workspace administrator needs to use 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.
Example
{
"users": [
{
"username": "john.doe",
"emails": [
"[email protected]"
],
"importIds": [
"1523"
],
"name": "John Doe",
"password": "P@ssw0rd"
},
{
"username": "jane.doe",
"emails": [
"[email protected]"
],
"importIds": [
"1524"
],
"name": "Jane Doe"
}
]
}
object
users
Array of object
object
username
string
The user name.
emails
Array of string Required
The user email addresses.
string
importIds
Array of string Required
A list of IDs that can identify the user.
string
name
string
The user's display name.
password
string
A password to assign to this user.
utcOffset
number
The user's timezone, in number of hours relative to UTC.
roles
Array of string
A list of roles to assign to the user
string
type
string
The user type, must be either "user" or "bot".
bio
string
The user's profile bio.
deleted
boolean
Was the user deleted from the previous system?
avatarUrl
string
A URL pointing to the user's avatar picture.
Responses
200
OK
Success
{
"success": true
}
object
success
boolean
401
Unauthorized
Authorization Error
{
"status": "error",
"message": "You must be logged in to do this."
}
object
status
string
message
string
403
Forbidden
Permission Error
{
"success": false,
"error": "User does not have the permissions required for this action [error-unauthorized]"
}
object
success
boolean
error
string
Was this article helpful?