Spotlight

Searches for users or rooms that are visible to the user.

WARNING: It will only return rooms that user didn't join yet.

URLRequires AuthHTTP Method

/api/v1/spotlight

yes

GET

Example Call

curl -H "X-Auth-Token: 6eWs4ECxUITYYoZ_bAYK5OE2srkxAepQqQA1cGGv3jK" \
     -H "X-User-Id: hvzu8z6mHFigiXy6Y" \
     http://localhost:3000/api/v1/spotlight?query=foobar

Example Call

curl -H "X-Auth-Token: 6eWs4ECxUITYYoZ_bAYK5OE2srkxAepQqQA1cGGv3jK" \
     -H "X-User-Id: hvzu8z6mHFigiXy6Y" \
     http://localhost:3000/api/v1/spotlight?query=@foobar

Example Call

curl -H "X-Auth-Token: 6eWs4ECxUITYYoZ_bAYK5OE2srkxAepQqQA1cGGv3jK" \
     -H "X-User-Id: hvzu8z6mHFigiXy6Y" \
     http://localhost:3000/api/v1/spotlight?query=#foobar

Query Parameters

ArgumentExampleRequiredDescription

query

john

Required

The term to be searched. Supports '#' for channels and '@' for users

Example Result

{
  "users": [
    {
      "_id": "rocket.cat",
      "name": "Rocket.Cat",
      "username": "rocket.cat",
      "status": "online",
      "avatarETag": "5BB9B5ny5DkKdrwkq"
    }
  ],
  "rooms": [],
  "success": true
}

Change Log

VersionDescription

0.64.0

Added support to '#' and '@' searches, for channels and users respectively.

0.61.0

Added.

Last updated

Rocket.Chat versions receive support for six months after release.