Join a Channel

Prev Next
Post
/api/v1/channels.join

Join a public channel.

Changelog

Version Description
0.49.0 Added
Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

The userId of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ
Body parameters
Example
{
  "roomId": "ByehQjC44FwMeiLbX",
  "joinCode": "1234"
}
object
roomId
string Required

The channel ID.

joinCode
string

The join code of the room. Channels can be password-protected. In that case, users must enter the password for access. See Channel information for details. The join code isn't needed if the user has the join-without-join-code permission.

Responses
200

OK

Example
{
  "channel": {
    "_id": "nxXKHF2o2nzKYtFMM",
    "name": "test",
    "fname": "test",
    "t": "c",
    "msgs": 8,
    "usersCount": 2,
    "u": {
      "_id": "rocketchat.internal.admin.test",
      "username": "rocketchat.internal.admin.test"
    },
    "customFields": {},
    "broadcast": false,
    "encrypted": false,
    "ts": "2019-01-16T12:00:04.783Z",
    "ro": false,
    "sysMes": true,
    "default": false,
    "_updatedAt": "2019-01-16T12:06:30.426Z",
    "joinCodeRequired": true
  },
  "success": true
}
Expand All
object
channel
object
_id
string
fname
string
customFields
object
topic
string
broadcast
boolean
encrypted
boolean
name
string
t
string
msgs
integer
usersCount
integer
u
object
_id
string
username
string
ts
string
ro
boolean
default
boolean
sysMes
boolean
_updatedAt
string
lastMessage
object
_id
string
rid
string
msg
string
ts
string
u
object
_id
string
username
string
name
string
_updatedAt
string
urls
Array of object
object
mentions
Array of object
object
channels
Array of object
object
md
Array of object
object
type
string
value
Array of object
object
type
string
value
string
lm
string
success
boolean
401

Unauthorized

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