For AI agents: Find a documentation index at https://talkjs.com/llms.txt (full content at https://talkjs.com/llms-full.txt). Get a markdown version of any page by appending .md to its URL path.

Add users to a group chat

Add participants from your frontend or backend, and allow guests.

View as Markdown

This page covers the Classic SDK. For new projects, use the Components SDK, which pairs with the Data API to create users.

You can add participants to a group chat, either from your frontend or from your backend using the REST API. You can't directly add guest users to a group chat, as guests aren't members of a conversation. You can, however enable or turn off guest access.

Users can join a group chat at any time during the lifetime of a conversation. Joining a chat works differently for participants and guests, in the following way.

Add a participant

You can programmatically add participants to a group chat either from your frontend or from your backend, as follows.

Frontend

To add a participant to a conversation from your frontend, use ParticipantRef from the JavaScript Data API or JavaScript Chat SDK.

Backend

To add a participant to a conversation from your backend, call the Join conversation endpoint of our REST API.

Allow joining as a guest

You can't add guests to a conversation in the same way as you can add participants. Instead, you can set things up so that users who aren't participants in a conversation can access that conversation as a guest.

To allow a user to join a conversation as a guest, enable guest access and make a chat interface with that conversation available to the user. Any user who knows the conversation’s ID and is not already a participant in that conversation, can now access this conversation as a guest.