Directory

Prev Next
Get
/api/v1/directory

Search workspace directory for users, channels and teams.

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
Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

The userId of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ
Query parameters
text
string

The search term to be filtered

Examplerocket
type
string

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.

Exampleusers
workspace
string

It can be local or all( if federation is enabled). It is local by default.

Examplelocal
query
Required

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.

Example{"text": "rocket", "type": "users", "workspace": "local"}
offset
integer

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.

Example50
count
integer

The number of items to return. Refer to the official documentation to learn more.

Example50
sort

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.

fields
string

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.

Responses
200
401

OK

Collapse all
object
result
Array of object
object
_id
string
createdAt
string
emails
Array of object
object
name
string
username
string
avatarETag
string
count
integer
offset
integer
total
integer
success
boolean