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();{
"org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
"chat_id": "[email protected]",
"members": {
"[email protected]": {
"org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
"chat_id": "[email protected]",
"is_admin": true,
"org_phone": "[email protected]",
"contact_id": "[email protected]",
"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
},
"[email protected]": {
"org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
"chat_id": "[email protected]",
"is_admin": false,
"org_phone": "[email protected]",
"contact_id": "[email protected]",
"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": "[email protected]",
"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": {
"[email protected]": 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
}This endpoint allows a user to accept a group invite
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();{
"org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
"chat_id": "[email protected]",
"members": {
"[email protected]": {
"org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
"chat_id": "[email protected]",
"is_admin": true,
"org_phone": "[email protected]",
"contact_id": "[email protected]",
"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
},
"[email protected]": {
"org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
"chat_id": "[email protected]",
"is_admin": false,
"org_phone": "[email protected]",
"contact_id": "[email protected]",
"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": "[email protected]",
"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": {
"[email protected]": 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
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
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
"{{orgPhone}}"
"EUKdz8Sdy9T2UWPnOKGkxx"
200 OK
The response is a chat object. Refer to the chat object here
Was this page helpful?