Group
Group Management API
Section titled “Group Management API”This API allows bots to manage groups, including creating groups, adding/removing members, and updating group information.
Create Group
Section titled “Create Group”Request URL : baseURL/bot/{chatmeBotToken}/create-group
Http method : POST
Auth required : YES
Data constraints
{ "name": "[group name] (required)", "members": "[array of user IDs to add to the group] (required)", "description": "[group description] (optional)", "avatar": "[attachment ID for group avatar] (optional)"}
Data example
{ "name": "My Bot Group", "members": ["644788d114ce799315bfc502", "644788d114ce799315bfc503"], "description": "A group created by my bot"}
Success Response
Section titled “Success Response”Content example
{ "data": { "group": { "_id": "685e19b026c11e7141154123", "name": "My Bot Group", "description": "A group created by my bot", "avatar": null, "createdAt": "2025-06-29T07:39:17.534Z", "createdBy": "644788d114ce799315bfc502", "members": [ { "_id": "644788d114ce799315bfc502", "name": "User1", "role": "owner" }, { "_id": "644788d114ce799315bfc503", "name": "User2", "role": "member" } ] } }}
Error Codes
Section titled “Error Codes”Error Code | Message | Http Status Code |
---|---|---|
40000 | validation failed | 400 |
10001 | user not found | 404 |
40030 | group creation failed | 400 |
40031 | invalid member list | 400 |
Get Group Members
Section titled “Get Group Members”This API allows to retrieve members of a group using the bot token.
Request
Section titled “Request”Request URL : baseURL/bot/{chatmeBotToken}/get-group-member
Http method : GET
Auth required : YES
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
roomId | string | Yes | ID of the room |
page | number | No | number of page |
limit | number | No | number of limit default 100 |
Example Request URL
baseURL/bot/{chatmeBotToken}/get-group-member?roomId=685bf2b7b7cc4fca65684b78
Success Response
Section titled “Success Response”Content example
{ "data":[{ "_id": "685bf2b7b7cc4fca65684b7f", "name": "ChatMe Bot", "role": "member", "accountId": "chatmebot", "avatar": "https://wrs.chat-me.chat/chat-me/1683093943859-image_picker_DABFA00A-BC3C-49E0-9A46-39A4291AD273-572-00000010F0532208.png", "lastOnlineAt": null, "country": "Cambodia", "userId": "64c8edc06716ab9db654212d", "firstLetterOfTheName": "c", "isOnline": false }, { "_id": "685e16c891184b1fe17a452a", "name": "dev2bot", "role": "member", "accountId": "dev2bot", "avatar": null, "lastOnlineAt": null, "country": "United States", "userId": "685e166d91184b1fe17a4494", "firstLetterOfTheName": "d", "isOnline": false }], "pagination": { "totalDocs": 2, "totalPages": 1, "hasPrevPage": false, "prevPage": null, "hasNextPage": false, "nextPage": null, "page": 1, "limit": 100 } }}
Empty Data Response
{ "data": [], "pagination": { "totalPages": 1, "hasPrevPage": false, "prevPage": null, "hasNextPage": false, "nextPage": null, "page": 1, "limit": 10 }}
Error Codes
Section titled “Error Codes”Error Code | Message | Http Status Code |
---|---|---|
40000 | validation failed | 400 |
10001 | user not found | 404 |
40023 | group does not exist | 404 |
50000 | unknown error | 500 |
40027 | Invalid request | 400 |
40022 | user not allowed to access group | 400 |
Restrict Member in Group for sending Message
Section titled “Restrict Member in Group for sending Message”This API allows to restrict a member from sending messages in a group using the bot token.
Request
Section titled “Request”Request URL : baseURL/bot/{chatmeBotToken}/disable-member-send-message
Http method : POST
Auth required : YES
Data constraints
{ "roomId": "[ID of the room]", "userId": "[ID of the user in room to restrict]", "isDisabled": "[boolean. default is true]"}
Data example
{ "roomId": "685bf2b7b7cc4fca65684b88", "userId": "685bf2b7b7cc4fca65684b7f"}
Success Response
Section titled “Success Response”Content example
{ "data": { "success": true, "message": "Member has been restricted from sending messages" }}
Error Codes
Section titled “Error Codes”Error Code | Message | Http Status Code |
---|---|---|
40032 | user does not have permission | 400 |
Restrict Group from sending message
Section titled “Restrict Group from sending message”This API allows to restrict all members (except the bot) from sending messages in a group. Only the bot will be allowed to send messages after this restriction is applied.
Request
Section titled “Request”Request URL : baseURL/bot/{chatmeBotToken}/disable-group-send-message
Http method : POST
Auth required : YES
Data constraints
{ "roomId": "[ID of the group]", "isDisabled": "[boolean. default is true]"}
Success Response
Section titled “Success Response”Content example
{ "data": { "privacy": { "isRequiredApproval": false, "isNameStricted": false }, "_id": "685e19b026c11e7141154133", "room": "685e19b026c11e7141154123", "name": "Haha22", "avatar": null, "isDeleted": false, "isActivated": true, "description": null, "agent": null, "referralCode": null, "totalMember": 3, "groupUId": "7bd43426-e066-45a4-adbf-e7e4bade6c79", "isDisabledSendingMessage": true, "isShowToggleMenu": false, "createdAt": "2025-06-27T04:10:24.051Z", "updatedAt": "2025-06-27T08:03:55.665Z", "__v": 0, "id": "685e19b026c11e7141154133" }}
Error Codes
Section titled “Error Codes”Error Code | Message | Http Status Code |
---|---|---|
10016 | group does not exist | 404 |
40032 | user does not have permission | 400 |
Toggle Menu
Section titled “Toggle Menu”This API allows to toggle the menu visibility status for a group. The request will update to the opposite of the current status (if currently shown, it will hide; if currently hidden, it will show).
Request
Section titled “Request”Request URL : baseURL/bot/{chatmeBotToken}/toggle-menu
Http method : PUT
Auth required : YES
Data constraints
{ "roomId": "[ID of room]"}
Data example
{ "roomId": "685e19b026c11e7141154123"}
Success Response
Section titled “Success Response”Content example
{ "data": { "privacy": { "isRequiredApproval": false, "isNameStricted": false }, "_id": "685e19b026c11e7141154133", "room": "685e19b026c11e7141154123", "name": "Haha22", "avatar": null, "isDeleted": false, "isActivated": true, "description": null, "agent": null, "referralCode": null, "totalMember": 3, "groupUId": "7bd43426-e066-45a4-adbf-e7e4bade6c79", "isDisabledSendingMessage": true, "isShowToggleMenu": true, "createdAt": "2025-06-27T04:10:24.051Z", "updatedAt": "2025-06-27T08:03:55.665Z", "__v": 0, "id": "685e19b026c11e7141154133" }}
Error Codes
Section titled “Error Codes”Error Code | Message | Http Status Code |
---|---|---|
10016 | group does not exist | 404 |
40032 | user does not have permission | 400 |
Get Command List
Section titled “Get Command List”This API allows to retrieve the list of available commands for a bot in a specific group.
Request
Section titled “Request”Request URL : baseURL/bot/{chatmeBotToken}/commands
Http method : GET
Auth required : YES
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
roomId | string | Yes | ID of the group |
Example Request URL
baseURL/bot/{chatmeBotToken}/commands?roomId=685e19b026c11e7141154133
Success Response
Section titled “Success Response”Content example
{ "data": [ { "bot": "685e19b026c11e7141154133", "room": "485e19b026c11e7141154122", "command": "/start", "description": "Start using the bot" }, { "bot": "685e19b026c11e7141154133", "room": "485e19b026c11e7141154122", "command": "/help", "description": "Show help information" }, { "bot": "685e19b026c11e7141154133", "room": "485e19b026c11e7141154122", "command": "/settings", "description": "Configure bot settings" } ], "pagination": { "totalPages": 1, "hasPrevPage": false, "prevPage": null, "hasNextPage": false, "nextPage": null, "page": 1, "limit": 10 }}
Empty Data Response
{ "data": [], "pagination": { "totalPages": 1, "hasPrevPage": false, "prevPage": null, "hasNextPage": false, "nextPage": null, "page": 1, "limit": 10 }}
Error Codes
Section titled “Error Codes”Error Code | Message | Http Status Code |
---|---|---|
10016 | group does not exist | 404 |
Create Command
Section titled “Create Command”This API allows to create a new command for a bot.
Request
Section titled “Request”Request URL : baseURL/bot/{chatmeBotToken}/create-command
Http method : POST
Auth required : YES
Data constraints
{ "roomId": "[ID of the room]", "command": "[command name starting with /]", "description": "[description of the command]", "forRoles": ["Array of string with enum admin/owner/member "]}
Data example
{ "roomId": "685e19b026c11e7141154123", "command": "/newbot", "description": "create new bot", "forRoles":["admin"]}
Success Response
Section titled “Success Response”Content example
{ "data": { "bot": "685e19b026c11e7141154133", "room": "685e19b026c11e7141154123", "command": "/newbot", "description": "create new bot", "forRoles":["admin"] }}
Error Codes
Section titled “Error Codes”Error Code | Message | Http Status Code |
---|---|---|
10011 | room does not exist | 404 |
Delete Command
Section titled “Delete Command”This API allows to delete an existing command for a bot.
Request
Section titled “Request”Request URL : baseURL/bot/{chatmeBotToken}/delete-command/{commandId}
Http method : DELETE
Auth required : YES
URL Parameters
Parameter | Type | Required | Description |
---|---|---|---|
commandId | string | Yes | ID of command to delete |
Example Request URL
baseURL/bot/{chatmeBotToken}/delete-command/6863a5a9b026471c3ce3ef5e
Success Response
Section titled “Success Response”Content example
{ "data": { "success": true, }}
Error Codes
Section titled “Error Codes”Error Code | Message | Http Status Code |
---|---|---|
40089 | command does not exist | 404 |