Create Group
- Print
- DarkLight
- PDF
Create Group
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Post
/api/v1/groups.create
Creates a new group/channel, optionally including specified users. The group creator is always included.
Changelog
Version | Description |
---|---|
6.4.1 | Added excludeSelf param |
0.35.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
{
"name": "groupname",
"members": [
"rocket.cat"
],
"readOnly": true,
"excludeSelf": true,
"customFields": {
"type": "default"
},
"extraData": {
"broadcast": true,
"encrypted": false,
"teamId": "658441562dd9f928ad9951aa"
}
}
object
readOnly
boolean
Set if the group is read only or not. The default value is false.
members
Array of string
The users to add to the group when it is created.
string
excludeSelf
boolean
If set to true the user calling the endpoint is not automatically added as a member of the group. The default value is false.
name
string Required
The name of the new private group.
customFields
object
If you have defined custom fields for your workspace, you can provide them in this object parameter.
extraData
object
Enter the following details for the object:
broadcast
: Whether the group should be a broadcast groupencrypted
: Whether the group should be encrypted.teamId
: Enter the team ID for which you want to create a group.
For more information, see Channels.
Responses
200
OK
Success
{
"group": {
"_id": "NtR6RQ7NvzA9ejecX",
"name": "testing",
"t": "p",
"msgs": 0,
"u": {
"_id": "aobEdbYhXfu5hkeqG",
"username": "tester"
},
"ts": "2016-12-09T16:53:06.761Z",
"ro": false,
"sysMes": true,
"_updatedAt": "2016-12-09T16:53:06.761Z"
},
"success": true
}
object
group
object
_id
string
name
string
t
string
msgs
integer
u
object
_id
string
username
string
ts
string
ro
boolean
sysMes
boolean
_updatedAt
string
success
boolean
401
Unauthorized
Authorization Error
{
"status": "error",
"message": "You must be logged in to do this."
}
object
status
string
message
string
Was this article helpful?