import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: '919876543210', // the phone to act with (x-phone)
});
async function main() {
const response = await client.chats.createGroup({
group_name: 'Example Group',
participants: [
'922222222222',
],
});
console.log(response);
}
main();curl -X POST 'https://api.periskope.app/v1/chats/create' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-phone: 919876543210' \
-H 'Content-Type: application/json' \
-d '{
"group_name": "Example Group",
"participants": [
"922222222222"
]
}'{
"org_id": "00000000-0000-0000-0000-000000000000",
"chat_id": "120363000000000000@g.us",
"org_phone": "911111111111@c.us",
"chat_name": "Example Group",
"chat_type": "group",
"chat_image": "https://example.com/images/example.jpg",
"invite_link": "https://chat.whatsapp.com/invite/AAAAAAAAAAAAAAAAAAAAAA",
"label_ids": {
"label-aaaaaaaaaaaaaaaa": true
},
"labels": [
"priority"
],
"custom_properties": {
"Custom Property": "Value"
},
"assigned_to": "user@example.com",
"chat_access": {
"user@example.com": true
},
"group_description": "A sample group description",
"info_admins_only": false,
"messages_admins_only": false,
"add_members_admins_only": false,
"member_count": 12,
"members": {
"key": {
"org_id": "00000000-0000-0000-0000-000000000000",
"chat_id": "120363000000000000@g.us",
"org_phone": "911111111111@c.us",
"contact_id": "922222222222@c.us",
"contact_name": "John Doe",
"contact_image": "https://example.com/images/example.jpg",
"contact_color": "#000000",
"is_admin": false,
"is_super_admin": false,
"is_internal": false
}
},
"latest_message": {
"message_id": "true_120363000000000000@g.us_AAAAAAAAAAAAAAAAAAAAAA",
"org_id": "00000000-0000-0000-0000-000000000000",
"org_phone": "911111111111@c.us",
"chat_id": "120363000000000000@g.us",
"body": "Hello! This is a sample message.",
"message_type": "chat",
"from_me": true,
"author": "922222222222@c.us",
"ack": "4",
"timestamp": "2026-01-15T09:30:00+00:00",
"media": {
"path": "https://example.com/images/example.jpg",
"mimetype": "image/png",
"filename": "image.png"
},
"mentioned_ids": [
"922222222222@c.us"
],
"performed_by": "api",
"quoted_message_id": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"sender_phone": "911111111111@c.us",
"sent_message_id": "00000000-0000-0000-0000-000000000000",
"delivery_info": {
"delivered": {
"key": null
},
"read": {
"key": null
},
"pending": [
null
],
"read_count": null,
"delivered_count": null
},
"is_deleted": null,
"is_forwarded": null,
"is_starred": null,
"has_media": null,
"unique_id": "AAAAAAAAAAAAAAAAAAAAAA",
"updated_at": "2026-01-15T09:31:12.884+00:00"
},
"latest_message_timestamp": "2026-01-15T09:30:00+00:00",
"message_unread_count": 0,
"flag_count_map": {
"key": null
},
"parent_community_id": null,
"is_archived": false,
"group_metadata": {},
"is_muted": false,
"is_exited": false,
"closed_at": null,
"created_at": "2026-01-10T08:00:00+00:00",
"updated_at": "2026-01-15T09:30:00.025233+00:00"
}{
"code": "ERROR",
"message": "The phone is disconnected or its server is off/unreachable",
"status": 400
}{
"code": "UNAUTHORIZED_ERROR",
"message": "Invalid bearer auth token",
"status": 401
}{
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"status": 422,
"fields": {
"body.chat_id": {
"message": "chat_id is required"
}
}
}{
"code": "RATE_LIMIT_ERROR",
"message": "You can only make 100 requests per second",
"status": 429
}{
"code": "UNKNOWN_ERROR",
"message": "Internal server error",
"status": 500
}Create Group
Creates a WhatsApp group through the phone in the x-phone header and returns its chat object. Participants whose privacy settings disallow direct adds receive an invite instead.
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: '919876543210', // the phone to act with (x-phone)
});
async function main() {
const response = await client.chats.createGroup({
group_name: 'Example Group',
participants: [
'922222222222',
],
});
console.log(response);
}
main();curl -X POST 'https://api.periskope.app/v1/chats/create' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-phone: 919876543210' \
-H 'Content-Type: application/json' \
-d '{
"group_name": "Example Group",
"participants": [
"922222222222"
]
}'{
"org_id": "00000000-0000-0000-0000-000000000000",
"chat_id": "120363000000000000@g.us",
"org_phone": "911111111111@c.us",
"chat_name": "Example Group",
"chat_type": "group",
"chat_image": "https://example.com/images/example.jpg",
"invite_link": "https://chat.whatsapp.com/invite/AAAAAAAAAAAAAAAAAAAAAA",
"label_ids": {
"label-aaaaaaaaaaaaaaaa": true
},
"labels": [
"priority"
],
"custom_properties": {
"Custom Property": "Value"
},
"assigned_to": "user@example.com",
"chat_access": {
"user@example.com": true
},
"group_description": "A sample group description",
"info_admins_only": false,
"messages_admins_only": false,
"add_members_admins_only": false,
"member_count": 12,
"members": {
"key": {
"org_id": "00000000-0000-0000-0000-000000000000",
"chat_id": "120363000000000000@g.us",
"org_phone": "911111111111@c.us",
"contact_id": "922222222222@c.us",
"contact_name": "John Doe",
"contact_image": "https://example.com/images/example.jpg",
"contact_color": "#000000",
"is_admin": false,
"is_super_admin": false,
"is_internal": false
}
},
"latest_message": {
"message_id": "true_120363000000000000@g.us_AAAAAAAAAAAAAAAAAAAAAA",
"org_id": "00000000-0000-0000-0000-000000000000",
"org_phone": "911111111111@c.us",
"chat_id": "120363000000000000@g.us",
"body": "Hello! This is a sample message.",
"message_type": "chat",
"from_me": true,
"author": "922222222222@c.us",
"ack": "4",
"timestamp": "2026-01-15T09:30:00+00:00",
"media": {
"path": "https://example.com/images/example.jpg",
"mimetype": "image/png",
"filename": "image.png"
},
"mentioned_ids": [
"922222222222@c.us"
],
"performed_by": "api",
"quoted_message_id": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"sender_phone": "911111111111@c.us",
"sent_message_id": "00000000-0000-0000-0000-000000000000",
"delivery_info": {
"delivered": {
"key": null
},
"read": {
"key": null
},
"pending": [
null
],
"read_count": null,
"delivered_count": null
},
"is_deleted": null,
"is_forwarded": null,
"is_starred": null,
"has_media": null,
"unique_id": "AAAAAAAAAAAAAAAAAAAAAA",
"updated_at": "2026-01-15T09:31:12.884+00:00"
},
"latest_message_timestamp": "2026-01-15T09:30:00+00:00",
"message_unread_count": 0,
"flag_count_map": {
"key": null
},
"parent_community_id": null,
"is_archived": false,
"group_metadata": {},
"is_muted": false,
"is_exited": false,
"closed_at": null,
"created_at": "2026-01-10T08:00:00+00:00",
"updated_at": "2026-01-15T09:30:00.025233+00:00"
}{
"code": "ERROR",
"message": "The phone is disconnected or its server is off/unreachable",
"status": 400
}{
"code": "UNAUTHORIZED_ERROR",
"message": "Invalid bearer auth token",
"status": 401
}{
"code": "VALIDATION_ERROR",
"message": "Request validation failed",
"status": 422,
"fields": {
"body.chat_id": {
"message": "chat_id is required"
}
}
}{
"code": "RATE_LIMIT_ERROR",
"message": "You can only make 100 requests per second",
"status": 429
}{
"code": "UNKNOWN_ERROR",
"message": "Internal server error",
"status": 500
}Authorizations
Your Periskope API token, sent as Authorization: Bearer <token>. Generate one from the Periskope dashboard under Settings → API & Webhooks. API access requires an active Pro or Enterprise plan.
Headers
Phone to act with: country code + number without symbols or spaces (e.g. 911111111111), or a phone_id (phone-xxxxxxxxxxxx). The phone must be connected to the org and accessible by the API token.
1"919876543210"
Body
Name (subject) of the group to create
1"Example Group"
Phone numbers to add to the group (country code + number, e.g. 922222222222). Per WhatsApp policy a participant is added directly only when their privacy settings allow it and they are in your phone contacts — everyone else receives an invite to join.
1Phone number of the participant, as country code + number without symbols or spaces
1"922222222222"
["922222222222"]
Additional settings for the new group
Show child attributes
Show child attributes
Response
The chat object of the newly created group
A WhatsApp chat (1-1 conversation or group) synced into the workspace, together with its Periskope attributes (labels, assignee, custom properties, status).
The unique identifier of the organization that owns the WhatsApp account.
"00000000-0000-0000-0000-000000000000"
The unique identifier of the WhatsApp chat (format: {phone_number}@c.us for individual chats or {group_id}@g.us for groups).
"120363000000000000@g.us"
The organization phone that the chat belongs to (in the format {phone_number}@c.us).
"911111111111@c.us"
The display name of the chat. For groups, this is the group name. For individual chats, this is the contact's name.
"Example Group"
The type of chat. Can be group, user, or business.
"group"
The URL of the chat's profile image.
"https://example.com/images/example.jpg"
The invite link of the chat. Group chats only, and only when the phone is an admin.
"https://chat.whatsapp.com/invite/AAAAAAAAAAAAAAAAAAAAAA"
A map of label identifiers associated with the chat, where keys are label IDs and values are booleans.
Show child attributes
Show child attributes
{ "label-aaaaaaaaaaaaaaaa": true }
An array of labels associated with the chat.
["priority"]
A map of custom properties associated with the chat. Values depend on the property type: dropdown, text, date.
{ "Custom Property": "Value" }
The email address of the user assigned to this chat. Absent when unassigned.
"user@example.com"
A map of user access permissions, where keys are email addresses and values are booleans. Absent when no per-chat overrides exist.
Show child attributes
Show child attributes
{ "user@example.com": true }
The description text for group chats. Group chats only.
"A sample group description"
Indicates if only admins can modify group info.
false
Indicates if only admins can send messages in the group.
false
Indicates if only admins can add new members to the group.
false
The total number of participants in the chat.
12
A map of members in the chat, keyed by WhatsApp ID (format: {phone_number}@c.us). Only returned when fetching a single chat by id — list results omit it.
Show child attributes
Show child attributes
An object containing details about the latest message sent in the chat.
Show child attributes
Show child attributes
Timestamp of the most recent message in the chat, as an ISO 8601 UTC timestamp.
"2026-01-15T09:30:00+00:00"
The number of unread messages in the chat.
0
A map of flagged messages, where keys are phone numbers and values are flagged messages count.
Show child attributes
Show child attributes
Indicates the id of the parent community for the group.
Indicates if the chat has been archived.
false
Additional raw group metadata synced from WhatsApp, when present
Indicates if notifications for this chat are muted.
false
Indicates if the organization has left this chat.
false
The timestamp when the chat was closed, if applicable, as an epoch timestamp in milliseconds. Absent while the chat is open.
The ISO 8601 formatted timestamp when the chat was created.
"2026-01-10T08:00:00+00:00"
The ISO 8601 formatted timestamp when the chat was last updated.
"2026-01-15T09:30:00.025233+00:00"
Was this page helpful?