## Create `$client->chats->create(string accountID, ?bool allowInvite, ?string messageText, ?Mode mode, ?list participantIDs, ?string title, ?Type type, ?User user): ChatNewResponse` **post** `/v1/chats` Create a single/group chat (mode='create') or start a direct chat from merged user data (mode='start'). ### Parameters - `accountID: string` Account to create or start the chat on. - `allowInvite?:optional bool` Whether invite-based DM creation is allowed when required by the platform. Used for mode='start'. - `messageText?:optional string` Optional first message content if the platform requires it to create the chat. - `mode?:optional Mode` Operation mode. Defaults to 'create' when omitted. - `participantIDs?:optional list` Required when mode='create'. User IDs to include in the new chat. - `title?:optional string` Optional title for group chats when mode='create'; ignored for single chats on most platforms. - `type?:optional Type` Required when mode='create'. 'single' requires exactly one participantID; 'group' supports multiple participants and optional title. - `user?:optional User` Required when mode='start'. Merged user-like contact payload used to resolve the best identifier. ### Returns - `ChatNewResponse` - `string chatID` Newly created chat ID. - `?Status status` Only returned in start mode. 'existing' means an existing chat was reused; 'created' means a new chat was created. ### Example ```php chats->create( accountID: 'accountID', allowInvite: true, messageText: 'messageText', mode: 'create', participantIDs: ['string'], title: 'title', type: 'single', user: [ 'id' => 'id', 'email' => 'email', 'fullName' => 'fullName', 'phoneNumber' => 'phoneNumber', 'username' => 'username', ], ); var_dump($chat); ```