logo
Updates a group or business channel — its title, name, description, category or photo.
💡 Send the whole chat object with an id. Fields you omit are left unchanged.

Request

method is "setChat".
Field
Type
Required
Description
chat
Yes
The chat to update. Must contain the id.
app_id
String
Yes
The app the chat belongs to.
reference
String
Optional
Your id for this request. Echoed back in the response.

Commonly set fields inside chat

Field
Type
Description
id
String
The chat being updated. Required.
title
String
Display title of the chat.
name
String
Short name of the chat.
description
String
Chat description.
category
String
Chat category.
photo
Object
{ "id": "<media_id>" } — upload the image first, then reference it by id.

Preconditions

Requirement
Why
"Manage Chats" permission
Needed to modify chats in the app.
Super admin in the chat
Editing chat details requires the highest role.

Response

chatDetails

Field
Type
Returned
Description
method
String
Yes
"chatDetails"
chat
Yes
The chat as it now stands, with a new version.
app_id
String
Yes
Echoed from the request.
reference
String
Optional
Echoed from the request.

SDKs

SDK
Call
Callback
Java
api.setChat(chat, appId, reference);
onChatDetails(Chat chat, String appId)
JavaScript
api.setChat(chat, appId, reference);
onChatDetails(chat, appId)
Python
napi.set_chat(chat=chat, app_id=app_id, reference=reference)
on_chat_details(self, chat, app_id)

Example

Request

json
{ "method": "setChat", "app_id": "90090684293000559", "reference": "123456789", "chat": { "id": "90090684438172188", "name": "New Chat", "photo": { "id": "V_vT9kSn_nullde6c172db6a9b5d9764ea99a1371ed5495d1dda12ffaa56b4b3b55428980b446.jpg" } } }
java
Chat chat = new Chat(); chat.setId("90090684438172188"); chat.setName("New Chat"); api.setChat(chat, "90090684293000559", "123456789");
javascript
let chat = new Chat(); chat.id = "90090684438172188"; chat.name = "New Chat!"; api.setChat(chat, "90090684293000559", "123456789");
python
chat = Chat() chat.id = "90090684438172188" chat.name = "NEW CHAT!" napi.set_chat(chat=chat, app_id="90090684293000559", reference="123456789")

Response

json
{ "method": "chatDetails", "app_id": "90090684293000559", "reference": "123456789", "chat": { "id": "90090684438172188", "title": "New Chat", "type": "Group", "description": "Test new group", "category": "S", "language_code": "en", "member_count": 3, "version": "l6op9p", "invite_link": "https://djoin.ndbx.me/join?id=oI8TSxmwrNoZlWQz4%2BdfdME01yf%2FXq1D4hGcb%2Fo8x2k%3D&type=Group&pay=0&vappId=0", "photo": { "id": "V_l6op9p_nullde6c172db6a9b5d9764ea99a1371ed5495d1dda12ffaa56b4b3b55428980b446.jpg", "width": 256, "height": 256, "thumbnail": { "id": "V_l6op9p_nullde6c172db6a9b5d9764ea99a1371ed5495d1dda12ffaa56b4b3b55428980b446.jpg.thumb.jpg", "width": 120, "height": 120 } }, "image": "/9j/4AAQSkZJRgABAgAAAQABAAD…", "tagsDefinition": null } }
💡 image is the chat photo inlined as base64 and can be very large. It is truncated above.

Powered by Notaku