Autocomplete Room Name With Pagination

Prev Next
Get
/api/v1/rooms.autocomplete.channelAndPrivate.withPagination

List the public and private rooms whose names match a given string, excluding discussions, DMs, and omnichannel rooms. The endpoint is valuable when performing search operations. It returns only rooms that the user belongs to. This endpoint includes pagination query parameters.

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
count
integer

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

Example50
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
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.

selector
stringRequired

The search term to be completed. It only applies to the room name.

Example{"name":"api"}
Responses
200

OK

Example 1
{
  "items": [
    {
      "_id": "66c82e1e237405fc05fc1ef4",
      "fname": "api-team",
      "name": "api-team",
      "t": "c"
    },
    {
      "_id": "66c88dae237405fc05fc1f06",
      "fname": "api-team2",
      "name": "api-team2",
      "t": "p"
    }
  ],
  "total": 4,
  "success": true
}
Expand All
object
items
Array of object
object
_id
string
fname
string
name
string
t
string
total
integer
success
boolean
400

Bad Request

Example 1
{
  "success": false,
  "error": "The 'selector' param is required"
}
object
success
boolean
error
string
401

Unauthorized

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