Links

Set Group Custom Fields

Sets the custom fields for the group/channel.
HTTP Method
URL
Requires Auth
POST
/api/v1/groups.setCustomFields
yes

Body Parameters

Only one of the roomId or roomName parameters is required.
Key
Example Value
Description
roomId*
euzoT67Gx6nXcn66M
The group ID.
roomName*
channel.cf.1518990680083
The group name.
customFields*
{"company": "sell-and-more"}
The custom fields to set for the group.

Example Call

curl -H "X-Auth-Token: 8h2mKAwxB3AQrFSjLVKMooJyjdCFaA7W45sWlHP8IzO" \
-H "X-User-Id: ew28FnZqipDpvKw3R" \
-H "Content-type: application/json" \
http://localhost:3000/api/v1/groups.setCustomFields \
-d '{
"roomId": "euzoT67Gx6nXcn66M",
"customFields":{"company": "sell-and-more"} }'

Example Response

{
"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."
}

Change Log

Version
Description
0.62.0
Added
Last modified 2mo ago
Rocket.Chat versions receive support for six months after release.