Skip to content

Group

This API allows bots to manage groups, including creating groups, adding/removing members, and updating group information.

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

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 CodeMessageHttp Status Code
40000validation failed400
10001user not found404
40030group creation failed400
40031invalid member list400

This API allows to retrieve members of a group using the bot token.

Request URL : baseURL/bot/{chatmeBotToken}/get-group-member

Http method : GET

Auth required : YES

Query Parameters

ParameterTypeRequiredDescription
roomIdstringYesID of the room
pagenumberNonumber of page
limitnumberNonumber of limit default 100

Example Request URL

baseURL/bot/{chatmeBotToken}/get-group-member?roomId=685bf2b7b7cc4fca65684b78

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 CodeMessageHttp Status Code
40000validation failed400
10001user not found404
40023group does not exist404
50000unknown error500
40027Invalid request400
40022user not allowed to access group400

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

Content example

{
"data": {
"success": true,
"message": "Member has been restricted from sending messages"
}
}
Error CodeMessageHttp Status Code
40032user does not have permission400

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 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]"
}

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 CodeMessageHttp Status Code
10016group does not exist404
40032user does not have permission400

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 URL : baseURL/bot/{chatmeBotToken}/toggle-menu

Http method : PUT

Auth required : YES

Data constraints

{
"roomId": "[ID of room]"
}

Data example

{
"roomId": "685e19b026c11e7141154123"
}

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 CodeMessageHttp Status Code
10016group does not exist404
40032user does not have permission400

This API allows to retrieve the list of available commands for a bot in a specific group.

Request URL : baseURL/bot/{chatmeBotToken}/commands

Http method : GET

Auth required : YES

Query Parameters

ParameterTypeRequiredDescription
roomIdstringYesID of the group

Example Request URL

baseURL/bot/{chatmeBotToken}/commands?roomId=685e19b026c11e7141154133

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 CodeMessageHttp Status Code
10016group does not exist404

This API allows to create a new command for a bot.

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"]
}

Content example

{
"data": {
"bot": "685e19b026c11e7141154133",
"room": "685e19b026c11e7141154123",
"command": "/newbot",
"description": "create new bot",
"forRoles":["admin"]
}
}
Error CodeMessageHttp Status Code
10011room does not exist404

This API allows to delete an existing command for a bot.

Request URL : baseURL/bot/{chatmeBotToken}/delete-command/{commandId}

Http method : DELETE

Auth required : YES

URL Parameters

ParameterTypeRequiredDescription
commandIdstringYesID of command to delete

Example Request URL

baseURL/bot/{chatmeBotToken}/delete-command/6863a5a9b026471c3ce3ef5e

Content example

{
"data": {
"success": true,
}
}
Error CodeMessageHttp Status Code
40089command does not exist404