Add all Users to a Channel

Post
/api/v1/channels.addAll

Adds all users in the workspace to a public room. Permission required: add-all-to-room. The maximum number of users you can add at once depends on your workspace's REST API settings. To access this setting, go to Administration > Settings > General > REST API > User Limit for Adding All Users to Channel.

Changelog

Version Description
0.55.0 Added activeUsersOnly param
0.48.0 Renamed to channels.addAll from channel.addAll
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": "WDuJLFkjwk6L7LdFC",
  "activeUsersOnly": true
}
object
roomId
string Required

The channel's ID.

activeUsersOnly
boolean

Add only active users. It is false by default.

Responses
200

OK

Success
{
  "channel": {
    "_id": "ByehQjC44FwMeiLbX",
    "name": "channelname",
    "t": "c",
    "usernames": [
      "example",
      "rocket.cat"
    ],
    "msgs": 0,
    "u": {
      "_id": "aobEdbYhXfu5hkeqG",
      "username": "example"
    },
    "ts": "2016-05-30T13:42:25.304Z"
  },
  "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