Search workspace directory for users, channels and teams.
Changelog
| Version | Description |
|---|---|
| 7.0.0 | Added type, workspace and text query parameters |
| 1.0.0 | Added workspace query param |
| 0.65.0 | Added Pagination fields: count, total, offset |
| 0.64.0 | Added |
The authToken of the authenticated user.
The userId of the authenticated user.
The search term to be filtered
It can be channels or users.
When type is users you can send an additional workspace field, that can be local (default) or all. Workspace=all will work only if federation is enabled.
It can be local or all( if federation is enabled). It is local by default.
The query to search the workspace directory. When type is users you can send an additional workspace field, that can be local (default) or all. Workspace=all will work only if federation is enabled.
Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items. Refer to the official documentation to learn more.
List of fields to order by, and in which direction. This is a JSON object, with properties listed in desired order, with values of 1 for ascending, or -1 for descending. For example, {"value": -1, "_id": 1}. Refer to the official documentation to learn more.
This parameter accepts a JSON object with properties that have a value of 1 or 0 to include or exclude them in the response. For example, to only retrieve the usernames of users: fields={ "username": 1 }. Refer to the official documentation to learn more.
OK
{
"result": [
{
"_id": "jRca8kibJx8NkLJxt",
"createdAt": "2018-04-13T12:46:26.517Z",
"emails": [
{
"address": "user.test.1523623548558@rocket.chat",
"verified": false
}
],
"name": "EditedRealNameuser.test.1523623548558",
"username": "editedusernameuser.test.1523623548558",
"avatarETag": "6YbLtc4v9b4conXon"
}
],
"count": 1,
"offset": 0,
"total": 1,
"success": true
}Unauthorized
{
"status": "error",
"message": "You must be logged in to do this."
}