> ## Documentation Index
> Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt
> Use this file to discover all available pages before exploring further.
# Set Channel Custom Fields
> Sets the custom fields for a channel. Permission required: `edit-room`.
See the Configure Custom Fields for Users document for configuration information.
### Changelog
| Version | Description |
| ------- | ----------- |
|0.62.0 | Added |
## OpenAPI
````json POST /api/v1/channels.setCustomFields
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "Rooms"
},
"servers": [
{
"url": "https://apiexplorer.support.rocket.chat"
}
],
"tags": [
{
"name": "Channels"
},
{
"name": "Directory"
},
{
"name": "Groups"
},
{
"name": "Rooms"
},
{
"name": "Teams"
},
{
"name": "Room Invites"
},
{
"name": "Subscriptions"
},
{
"name": "ABAC"
}
],
"paths": {
"/api/v1/channels.setCustomFields": {
"post": {
"tags": [
"Channels"
],
"summary": "Set Channel Custom Fields",
"description": "Sets the custom fields for a channel. Permission required: `edit-room`.\n\nSee the Configure Custom Fields for Users document for configuration information.\n\n### Changelog\n| Version | Description |\n| ------- | ----------- |\n|0.62.0 | Added |",
"operationId": "post-api-v1-channels.setCustomFields",
"parameters": [
{
"$ref": "#/components/parameters/UserId"
},
{
"$ref": "#/components/parameters/Auth-Token"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"roomId": {
"type": "string",
"description": "The channel's ID. Alternatively, enter the `roomName` parameter and provide the room's name as the value."
},
"customFields": {
"type": "object",
"description": "The custom fields to set for the channel.",
"properties": {
"organization": {
"type": "string"
}
}
}
},
"required": [
"roomId",
"customFields",
"organization"
]
},
"examples": {
"Example": {
"value": {
"roomId": "GENERAL",
"customFields": {
"organization": "tra-la-la"
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"channel": {
"type": "object",
"properties": {
"_id": {
"type": "string"
},
"fname": {
"type": "string"
},
"customFields": {
"type": "object",
"properties": {
"organization": {
"type": "string"
}
}
},
"topic": {
"type": "string"
},
"broadcast": {
"type": "boolean"
},
"encrypted": {
"type": "boolean"
},
"name": {
"type": "string"
},
"t": {
"type": "string"
},
"msgs": {
"type": "integer"
},
"usersCount": {
"type": "integer"
},
"u": {
"type": "object",
"properties": {
"_id": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"ts": {
"type": "string"
},
"ro": {
"type": "boolean"
},
"default": {
"type": "boolean"
},
"sysMes": {
"type": "boolean"
},
"_updatedAt": {
"type": "string"
},
"lastMessage": {
"type": "object",
"properties": {
"_id": {
"type": "string"
},
"rid": {
"type": "string"
},
"msg": {
"type": "string"
},
"ts": {
"type": "string"
},
"u": {
"type": "object",
"properties": {
"_id": {
"type": "string"
},
"username": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"_updatedAt": {
"type": "string"
},
"urls": {
"type": "array",
"items": {
"type": "object"
}
},
"mentions": {
"type": "array",
"items": {
"type": "object"
}
},
"channels": {
"type": "array",
"items": {
"type": "object"
}
},
"md": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"value": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
}
}
}
},
"lm": {
"type": "string"
},
"announcement": {
"type": "string"
}
}
},
"success": {
"type": "boolean"
}
}
},
"examples": {
"Success": {
"value": {
"channel": {
"_id": "WDuJLFkjwk6L7LdFC",
"fname": "new",
"customFields": {
"organization": "tra-la-la"
},
"topic": "",
"broadcast": false,
"encrypted": false,
"name": "new",
"t": "c",
"msgs": 72,
"usersCount": 45,
"u": {
"_id": "rbAXPnMktTFbNpwtJ",
"username": "roxie"
},
"ts": "2023-04-05T22:34:38.936Z",
"ro": false,
"default": false,
"sysMes": true,
"_updatedAt": "2023-09-27T05:24:34.363Z",
"lastMessage": {
"_id": "mBfC3sbNhfwcL4AQu",
"rid": "WDuJLFkjwk6L7LdFC",
"msg": "It should be good",
"ts": "2023-09-16T07:37:59.691Z",
"u": {
"_id": "rbAXPnMktTFbNpwtJ",
"username": "test.test",
"name": "test test"
},
"_updatedAt": "2023-09-16T07:37:59.815Z",
"urls": [],
"mentions": [],
"channels": [],
"md": [
{
"type": "PARAGRAPH",
"value": [
{
"type": "PLAIN_TEXT",
"value": "It should be good"
}
]
}
]
},
"lm": "2023-09-16T07:37:59.691Z",
"announcement": "Test out everything"
},
"success": true
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/authorizationError"
}
}
}
}
},
"components": {
"parameters": {
"UserId": {
"name": "X-User-Id",
"in": "header",
"description": "The `userId` of the authenticated user.",
"required": true,
"schema": {
"type": "string"
},
"example": "rbAXPnMktTFbNpwtJ"
},
"Auth-Token": {
"name": "X-Auth-Token",
"in": "header",
"description": "The `authToken` of the authenticated user.",
"required": true,
"schema": {
"type": "string"
},
"example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f"
}
},
"responses": {
"authorizationError": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"error": {
"type": "string"
}
}
},
"examples": {
"Authorization Error": {
"value": {
"success": false,
"error": "You must be logged in to do this."
}
}
}
}
}
}
}
}
}
````