Get Specific User's Presence

HTTP MethodURLRequires Auth

GET

/api/v1/users.getPresence

Query Parameters

KeyExample ValueDescription

userId* or username*

BsNr28znDkG8aeo7W or test

The ID or username of the user.

If not provided, the user who sending the request is retrieved.

Example Call

With userId:

curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
     -H "X-User-Id: aobEdbYhXfu5hkeqG" \
     http://localhost:3000/api/v1/users.getPresence?userId=BsNr28znDkG8aeo7W

With username:

curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
     -H "X-User-Id: aobEdbYhXfu5hkeqG" \
     http://localhost:3000/api/v1/users.getPresence?username=test

With no query parameter:

curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
     -H "X-User-Id: aobEdbYhXfu5hkeqG" \
     http://localhost:3000/api/v1/users.getPresence

Example Response

{
  "presence": "offline",
  "success": true
}

Change Log

VersionDescription

0.49.0

Updated to support userId or username

0.48.0

Renamed to users.getPresence

0.35.0

Added as user.getPresence

Last updated

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