Get Available Agent Information

Get
/api/v1/omnichannel/agents/available

Get information about the currently available agent. Permission required: manage-agent-extension-association

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

This parameter allows you to use MongoDB query operators to search for specific data. For example, to query users with a name that contains the letter "g": query = { "name": { "$regex": "g" } }. Refer to the official documentation to learn more.

text
string

The response is the data that contains this text.

includeExtension
string

The voice channel extension associated with the agent. If you don't enter any extension number, the endpoint returns a list of all agents who have not been assigned any extensions. For information about extensions, see Associate agents with extensions in Rocket.Chat.

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.

Example25
sort
(object)

List of fields to order by, and in which direction. JSON object, with properties listed in desired order, with values of 1 for ascending, or -1 for descending. For example, sort = {"value": -1, "_id": 1}. Refer to the official documentation to learn more.

Responses
200

OK

Success Example
{
  "agent": {
    "_id": "XycfA5CetCPuEjqxw",
    "username": "test.agent",
    "name": "agent123",
    "status": "online",
    "statusLivechat": "online",
    "emails": [
      {
        "address": "[email protected]",
        "verified": true
      }
    ],
    "livechat": {
      "maxNumberSimultaneousChat": "5"
    }
  },
  "success": true
}
Expand All
object
agent
object
_id
string
username
string
name
string
status
string
statusLivechat
string
emails
Array of object
object
address
string
verified
boolean
livechat
object
maxNumberSimultaneousChat
string
success
boolean
401

Unauthorized

Authorization Error
{
  "status": "error",
  "message": "You must be logged in to do this."
}
object
status
string
message
string
403

Forbidden

Permission Error
{
  "success": false,
  "error": "User does not have the permissions required for this action [error-unauthorized]"
}
Unauthorized
{
  "success": false,
  "error": "unauthorized"
}
object
success
boolean
error
string