Chat ID. What is it and how to get it?

Where to get the chat_id?

Each chat you see on your WhatsApp app has its own unique identifier.

These are private chat, group chat and WhatsApp channel.

Private chat is used to send personalized messages to the recipient. Group chat is used to organize communication between several participants in one group. Channel is used for unidirectional broadcasting tool where administrators can send text, photos, videos.

Before sending a message to these chats, a chat ID is required. You will get the chat_id in the response to requests (like Get messages) and in Webhooks.

Private chat or correspondent identifier

The format of the private chat identifier is based on the template 1234567890@s.whatsapp.net, where the recipient's phone number is used instead of the zeros. The phone number should be specified in full, with the country code and without spaces and without a plus. For example: 61399145883@s.whatsapp.net

Group chat ID

The group ID can be obtained only through the API: Get a list of groups The group ID looks like this: 120363194050948049@g.us

Channel ID

In order to find out the identifier use the following method: GET /newsletters The channel ID looks like this: 120363171743427809@newsletter

Last updated