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();
{
  "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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-phone
string

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

Body

application/json
invite_code
string
required
  • 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