Node.js
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: 'YOUR_PHONE_NUMBER', // e.g., '919876543210'
});
async function updateGroupSettings() {
const response = await client.group.updateSettings({
chat_id: '120363371308389685@g.us',
description: 'New description added'
});
console.log(response);
}
updateGroupSettings();curl -X POST \
https://api.periskope.app/v1/chats/{chat_id}/settings \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER' \
-d '{
"description": "New description added"
}'{
"add_members_admins_only": true,
"assigned_to": null,
"chat_access": {
"bharat@hashlabs.dev": true
},
"chat_id": "120363392071406466@g.us",
"chat_image": null,
"chat_name": "Test Group Name Change",
"chat_type": "group",
"closed_at": null,
"created_at": "2025-01-27T11:07:52+00:00",
"custom_properties": {},
"group_description": null,
"info_admins_only": false,
"invite_link": "https://chat.whatsapp.com/invite/CuZAuEnSB6e8sk7R3dopD3",
"is_exited": false,
"is_muted": false,
"label_ids": {},
"labels": [],
"latest_message": null,
"member_count": 3,
"messages_admins_only": false,
"org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
"org_phone": "918527184400@c.us",
"updated_at": "2025-01-27T11:11:09.102583+00:00"
}Group Settings APIs
Update Group Settings
This endpoint updates the settings of the group
Node.js
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: 'YOUR_PHONE_NUMBER', // e.g., '919876543210'
});
async function updateGroupSettings() {
const response = await client.group.updateSettings({
chat_id: '120363371308389685@g.us',
description: 'New description added'
});
console.log(response);
}
updateGroupSettings();curl -X POST \
https://api.periskope.app/v1/chats/{chat_id}/settings \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER' \
-d '{
"description": "New description added"
}'{
"add_members_admins_only": true,
"assigned_to": null,
"chat_access": {
"bharat@hashlabs.dev": true
},
"chat_id": "120363392071406466@g.us",
"chat_image": null,
"chat_name": "Test Group Name Change",
"chat_type": "group",
"closed_at": null,
"created_at": "2025-01-27T11:07:52+00:00",
"custom_properties": {},
"group_description": null,
"info_admins_only": false,
"invite_link": "https://chat.whatsapp.com/invite/CuZAuEnSB6e8sk7R3dopD3",
"is_exited": false,
"is_muted": false,
"label_ids": {},
"labels": [],
"latest_message": null,
"member_count": 3,
"messages_admins_only": false,
"org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
"org_phone": "918527184400@c.us",
"updated_at": "2025-01-27T11:11:09.102583+00:00"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Please provide the number of the phone you want to call with this API in the header. The number must be in country code + number format without any characters or spaces, e.g. 919876543210; Alternatively, provide the phone_id (phone-xxxxxxxxxxxx) in the header
Example:
"{{orgPhone}}"
Path Parameters
Example:
"120363392071406466@g.us"
Body
application/json
- When set to true, only admins can add other participants to the group
- Default true
Example:
true
- Updates the group description
Example:
""
- A public image URL to update the group image
Example:
""
- When set to true, only admins can edit group description or info
- Default false
Example:
""
- When set to true, only admins can send messages to the group.
- Default false
Example:
""
- Updates the name of the group
Example:
"Test Group Name Change"
- Sets the disappearing message duration in WhatsApp group
- 0: Off (no disappearing messages)
- 1: 24 hours
- 7: 7 days
- 90: 90 days
Example:
7
- When set to true, new members must be approved by an admin before joining the group
- Default false
Example:
true
Response
200 - application/json
200 OK
The response is a chat object for the updated group. Refer to the chat object here
Was this page helpful?