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 acceptGroupInvite() {
const response = await client.group.acceptGroupInvite({
invite_code: 'EUKdz8Sdy9T2UWPnOKGkx'
});
console.log(response);
}
acceptGroupInvite();curl -X POST \
https://api.periskope.app/v1/chats/accept-invite \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER' \
-d '{
"invite_code": "EUKdz8Sdy9T2UWPnOKGkx"
}'{
"org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
"chat_id": "120363420492168352@g.us",
"members": {
"918527184400@c.us": {
"org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
"chat_id": "120363420492168352@g.us",
"is_admin": true,
"org_phone": "918824248940@c.us",
"contact_id": "918527184400@c.us",
"is_internal": null,
"contact_name": "Support",
"contact_color": "#FF2E74",
"contact_image": "https://storage.googleapis.com/periskope-images/2997dd64-89bf-48d3-9a22-b314fca017e5%2F918527184400%40c.us.jpg?timestamp=1758592467197",
"is_super_admin": true
},
"918824248940@c.us": {
"org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
"chat_id": "120363420492168352@g.us",
"is_admin": false,
"org_phone": "918824248940@c.us",
"contact_id": "918824248940@c.us",
"is_internal": true,
"contact_name": "Hansal",
"contact_color": "#9333EA",
"contact_image": "https://storage.googleapis.com/periskope-images/2997dd64-89bf-48d3-9a22-b314fca017e5%2F918824248940%40c.us.jpg?timestamp=1758592465518",
"is_super_admin": false
}
},
"is_muted": false,
"chat_name": "Test South Donald",
"chat_type": "group",
"closed_at": null,
"is_exited": false,
"label_ids": {},
"labels": [],
"org_phone": "918824248940@c.us",
"chat_image": "https://storage.googleapis.com/periskope-images/2997dd64-89bf-48d3-9a22-b314fca017e5%2F120363420492168352%40g.us.jpg?timestamp=1758693649290",
"created_at": "2025-09-23T02:31:04+00:00",
"updated_at": "2025-09-24T06:00:49.294001+00:00",
"assigned_to": null,
"chat_access": {
"hansal.kothari@hashlabs.dev": true
},
"invite_link": null,
"is_archived": false,
"member_count": 2,
"flag_count_map": null,
"latest_message": null,
"info_admins_only": true,
"custom_properties": {},
"group_description": "my description",
"parent_community_id": null,
"message_unread_count": null,
"messages_admins_only": true,
"add_members_admins_only": true
}Group Settings APIs
Accept Group Invite
This endpoint allows a user to accept a group invite
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 acceptGroupInvite() {
const response = await client.group.acceptGroupInvite({
invite_code: 'EUKdz8Sdy9T2UWPnOKGkx'
});
console.log(response);
}
acceptGroupInvite();curl -X POST \
https://api.periskope.app/v1/chats/accept-invite \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER' \
-d '{
"invite_code": "EUKdz8Sdy9T2UWPnOKGkx"
}'{
"org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
"chat_id": "120363420492168352@g.us",
"members": {
"918527184400@c.us": {
"org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
"chat_id": "120363420492168352@g.us",
"is_admin": true,
"org_phone": "918824248940@c.us",
"contact_id": "918527184400@c.us",
"is_internal": null,
"contact_name": "Support",
"contact_color": "#FF2E74",
"contact_image": "https://storage.googleapis.com/periskope-images/2997dd64-89bf-48d3-9a22-b314fca017e5%2F918527184400%40c.us.jpg?timestamp=1758592467197",
"is_super_admin": true
},
"918824248940@c.us": {
"org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
"chat_id": "120363420492168352@g.us",
"is_admin": false,
"org_phone": "918824248940@c.us",
"contact_id": "918824248940@c.us",
"is_internal": true,
"contact_name": "Hansal",
"contact_color": "#9333EA",
"contact_image": "https://storage.googleapis.com/periskope-images/2997dd64-89bf-48d3-9a22-b314fca017e5%2F918824248940%40c.us.jpg?timestamp=1758592465518",
"is_super_admin": false
}
},
"is_muted": false,
"chat_name": "Test South Donald",
"chat_type": "group",
"closed_at": null,
"is_exited": false,
"label_ids": {},
"labels": [],
"org_phone": "918824248940@c.us",
"chat_image": "https://storage.googleapis.com/periskope-images/2997dd64-89bf-48d3-9a22-b314fca017e5%2F120363420492168352%40g.us.jpg?timestamp=1758693649290",
"created_at": "2025-09-23T02:31:04+00:00",
"updated_at": "2025-09-24T06:00:49.294001+00:00",
"assigned_to": null,
"chat_access": {
"hansal.kothari@hashlabs.dev": true
},
"invite_link": null,
"is_archived": false,
"member_count": 2,
"flag_count_map": null,
"latest_message": null,
"info_admins_only": true,
"custom_properties": {},
"group_description": "my description",
"parent_community_id": null,
"message_unread_count": null,
"messages_admins_only": true,
"add_members_admins_only": true
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Required. The phone that joins the group — this WhatsApp action is performed by this phone. Use country code + number format with no spaces or special characters (e.g. 919876543210), or the phone_id (phone-xxxxxxxxxxxx). This header is mandatory for this endpoint: the request is rejected with Missing Header: {x-phone} if it is not provided. Passing a phone that is outside your token's scope returns a 401.
Example:
"{{orgPhone}}"
Body
application/json
- Provide the invite code to accept the group invite
Example:
"EUKdz8Sdy9T2UWPnOKGkxx"
Response
200 - application/json
200 OK
The response is a chat object. Refer to the chat object here
Was this page helpful?