Skip to content
  • Auto
  • Light
  • Dark
Download Beeper

Create

Create a chat
chats.create(ChatCreateParams**kwargs) -> ChatCreateResponse
post/v1/chats

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

ParametersExpand Collapse
account_id: str

Account to create the chat on.

participant_ids: SequenceNotStr[str]

User IDs to include in the new chat.

type: Literal["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"
message_text: Optional[str]

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

title: Optional[str]

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

ReturnsExpand Collapse
class ChatCreateResponse:
chat_id: Optional[str]

Newly created chat if available.

Create a chat
from beeper_desktop_api import BeeperDesktop

client = BeeperDesktop(
    access_token="My Access Token",
)
chat = client.chats.create(
    account_id="local-whatsapp_ba_EvYDBBsZbRQAy3UOSWqG0LuTVkc",
    participant_ids=["string"],
    type="single",
)
print(chat)
{
  "success": true,
  "error": "error",
  "chatID": "!NCdzlIaMjZUmvmvyHU:beeper.com"
}
Returns Examples
{
  "success": true,
  "error": "error",
  "chatID": "!NCdzlIaMjZUmvmvyHU:beeper.com"
}