Directory
    • Dark
      Light
    • PDF

    Directory

    • Dark
      Light
    • PDF

    Article summary

    Get
    /api/v1/directory

    Search workspace directory for users, channels and teams.

    Changelog

    VersionDescription
    1.0.0Added workspace query param
    0.65.0Added Pagination fields: count, total, offset
    0.64.0Added
    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
    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.

    Example50
    count
    integer

    The number of items to return.

    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}

    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 }

    Responses
    200

    OK

    Example 1
    {
      "result": [
        {
          "_id": "jRca8kibJx8NkLJxt",
          "createdAt": "2018-04-13T12:46:26.517Z",
          "emails": [
            {
              "address": "[email protected]",
              "verified": false
            }
          ],
          "name": "EditedRealNameuser.test.1523623548558",
          "username": "editedusernameuser.test.1523623548558",
          "avatarETag": "6YbLtc4v9b4conXon"
        }
      ],
      "count": 1,
      "offset": 0,
      "total": 1,
      "success": true
    }
    Expand All
    object
    result
    Array of object
    object
    _id
    string
    createdAt
    string
    emails
    Array of object
    object
    address
    string
    verified
    boolean
    name
    string
    username
    string
    avatarETag
    string
    count
    integer
    offset
    integer
    total
    integer
    success
    boolean

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.