Skip to content
  • Auto
  • Light
  • Dark
Download Beeper

Create

Create a chat
client.chats.create(ChatCreateParams { accountID, participantIDs, type, 2 more } body, RequestOptionsoptions?): ChatCreateResponse { chatID }
post/v1/chats

Create a single or group chat on a specific account using participant IDs and optional title.

ParametersExpand Collapse
body: ChatCreateParams { accountID, participantIDs, type, 2 more }
accountID: string

Account to create the chat on.

participantIDs: Array<string>

User IDs to include in the new chat.

type: "single" | "group"

Chat type to create: 'single' requires exactly one participantID; 'group' supports multiple participants and optional title.

Accepts one of the following:
"single"
"group"
messageText?: string

Optional first message content if the platform requires it to create the chat.

title?: string

Optional title for group chats; ignored for single chats on most platforms.

ReturnsExpand Collapse
ChatCreateResponse { chatID }
chatID: string

Newly created chat ID.

Create a chat
import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop({
  accessToken: 'My Access Token',
});

const chat = await client.chats.create({
  accountID: 'accountID',
  participantIDs: ['string'],
  type: 'single',
});

console.log(chat.chatID);
{
  "chatID": "!NCdzlIaMjZUmvmvyHU:beeper.com"
}
Returns Examples
{
  "chatID": "!NCdzlIaMjZUmvmvyHU:beeper.com"
}