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.getChatById({
chat_id: '120363000000000000@g.us',
});
console.log(response);
}
main();curl -X GET 'https://api.periskope.app/v1/chats/120363000000000000@g.us' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-phone: 919876543210'{
"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": "UNAUTHORIZED_ERROR",
"message": "Invalid bearer auth token",
"status": 401
}{
"code": "NOT_FOUND_ERROR",
"message": "No chat matches chat_id on this phone",
"status": 404
}{
"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
}Get Chat By ID
Retrieves a chat by its chat_id, including its participants.
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.getChatById({
chat_id: '120363000000000000@g.us',
});
console.log(response);
}
main();curl -X GET 'https://api.periskope.app/v1/chats/120363000000000000@g.us' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'x-phone: 919876543210'{
"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": "UNAUTHORIZED_ERROR",
"message": "Invalid bearer auth token",
"status": 401
}{
"code": "NOT_FOUND_ERROR",
"message": "No chat matches chat_id on this phone",
"status": 404
}{
"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
Optional. Scope results to a single phone: country code + number without symbols or spaces (e.g. 911111111111), or a phone_id (phone-xxxxxxxxxxxx). Omit to return data across all phones the API token can access.
"919876543210"
Path Parameters
Unique id of the chat. For 1-1 chats, country code + number optionally suffixed with @c.us (e.g. 922222222222@c.us — the suffix is added automatically when omitted); for groups, the id ending with @g.us.
1"120363000000000000@g.us"
Response
The chat, including its members
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?