ChatsService lets you interact with iMessage chats at every level — from creating new conversations and managing group membership to controlling read state and presence indicators. Many operations that modify chat state (such as creating a chat, updating its name, or adding participants) require the Private API to be enabled on your BlueBubbles Server.
Access the service via your initialized client:
Chat metadata
getChatCount()
Get the total number of chats stored in your iMessage account on the server device.
get()
Fetch a chat’s database record and icon by its GUID. For group chats, this also returns the group icon if one has been set since the macOS host was first set up.
list()
Query chats from the database with optional filtering, related data, pagination, and sorting.
Related data to include in results. Accepted values:
"participants", "lastMessage", "sms", "archived", "message.attributed-body", "message.message-info-summary", "message.payload-data".Sort results by last message time. Must be
"lastmessage". Requires "lastMessage" to also be included in with.Creating and modifying chats
create()
Create a new iMessage chat. Requires the Private API and a minimum BlueBubbles Server version of 0.3.0.
A list of participant addresses (phone numbers or email addresses) to include in the new chat.
updateAChat()
Update an existing group chat’s display name. Requires the Private API.
deleteChat()
Delete a chat from the iMessage client on the macOS server. This change only affects the macOS server’s iMessage client — it does not propagate to other Apple devices on the account.
Group icon
setGroupIcon()
Set a group chat’s icon or photo. Requires the Private API.
removeGroupIcon()
Remove or unset the icon for a group chat. Requires the Private API.
Participants
addParticipantToChat()
Add a participant to an existing group chat. Include the country code in the address where possible. Requires the Private API.
The phone number or email address of the participant to add. Include the country code prefix (e.g.
"+15550001234" for a US number).removeParticipantFromChat()
Remove a participant from an existing group chat. Requires the Private API.
The participant address to remove is specified in the request body as
address. Requires the Private API (minimum server version 0.3.0).leaveChat()
Leave a group chat you are currently a member of. Throws an error if the target chat is not a group chat. Requires the Private API.
Messages in a chat
listMessages()
Fetch all messages associated with a specific chat.
Read state
markRead()
Mark a chat as read on the server. Dispatches a read event to all connected BlueBubbles clients. Requires the Private API.
markChatAsUnread()
Mark a chat as unread and dispatch an unread event to all connected BlueBubbles clients. On macOS Ventura, this also officially marks the chat as unread for other iOS devices. Requires the Private API and macOS Ventura.
If you are not running macOS Ventura, the event is still dispatched to BlueBubbles clients but the chat will not be marked as unread for other iOS devices. Requires the Private API and a minimum server version of 1.4.0.
Typing indicators
startSendTypingIndicator()
Start broadcasting a typing indicator to the participants of a chat. Requires the Private API.
Typing indicators stop automatically when you send a message to the chat. Requires the Private API.
stopSendTypingIndicator()
Stop broadcasting a typing indicator to a chat. Requires the Private API.
Typing indicators also stop automatically when you send any message to the chat. Requires the Private API.