Post
/api/v1/groups.setCustomFields
Sets the custom fields for the private channel.
Permission required: edit-room
Changelog
Version | Description |
---|---|
0.62.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": "euzoT67Gx6nXcn66M",
"customFields": {
"company": "sell-and-more"
}
}
object
roomId
string Required
The private group's ID. Alternatively, use the roomName
parameter and provide the room's name as the value. You can find the IDs by using any of the following endpoints:
- Get List of User Groups: This endpoint returns all private channels in the workspace, if you have the required permissions to view them.
- Get Groups: This endpoint returns the private channels that you are a member of.
customFields
object Required
The custom fields to set for the private group.
Responses
200
OK
Success
{
"group": {
"_id": "euzoT67Gx6nXcn66M",
"name": "channel.cf.1518990680083",
"fname": "channel.cf.1518990680083",
"t": "p",
"msgs": 0,
"u": {
"_id": "ew28FnZqipDpvKw3R",
"username": "rocketchat.internal.admin.test"
},
"customFields": {
"company": "sell-and-more"
},
"ts": "2018-02-18T21:51:20.091Z",
"ro": false,
"sysMes": true,
"_updatedAt": "2018-02-23T11:27:01.411Z",
"username": "rocketchat.internal.admin.test"
},
"success": true,
"developerWarning": "[WARNING]: The \"usernames\" field has been removed for performance reasons. Please use the \"*.members\" endpoint to get a list of members/users in a room."
}
object
group
object
_id
string
name
string
fname
string
t
string
msgs
integer
u
object
_id
string
username
string
customFields
object
company
string
ts
string
ro
boolean
sysMes
boolean
_updatedAt
string
username
string
success
boolean
developerWarning
string
401
Unauthorized
Authorization Error
{
"status": "error",
"message": "You must be logged in to do this."
}
object
status
string
message
string