MessagesService gives you full control over iMessage messaging through your BlueBubbles Server. You can send plain text, file attachments, multipart messages with inline mentions, and tapback reactions. The service also exposes query endpoints for fetching message history, counting totals, and a complete scheduling system for one-time and recurring future messages.
Access the service via your initialized client:
Sending messages
sendText()
Send a plain text iMessage to a chat.
Send method. One of
"apple-script" (default) or "private-api". Using subject, effectId, or selectedMessageGuid forces "private-api" automatically.iMessage effect identifier (e.g.
"com.apple.MobileSMS.expressivesend.invisibleink"). Requires Private API.The part index of the message to reply to when using threaded replies. Minimum
0. Requires macOS Big Sur or newer and BlueBubbles Server v1.4.0+.partIndex requires macOS Big Sur or newer and BlueBubbles Server v1.4.0+. subject, effectId, and selectedMessageGuid each require the Private API to be enabled on your server.sendAttachment()
Send a file attachment via iMessage.
Multipart form data body containing the attachment file. Supports the
method, subject, effectId, and selectedMessageGuid Private API parameters in the same way as sendText().Using
method: "private-api", subject, effectId, or selectedMessageGuid in the body will route the request through the Private API. partIndex requires macOS Big Sur+ and server v1.4.0+.sendMultipartMessage()
Send a multipart message that combines text, inline mentions, and pre-uploaded attachments in a single message.
An ordered array of message parts. Each part must include a
partIndex and either a text string or an attachment UUID (from a prior /attachment/upload call) with a name. Mention parts must include a mention field (email or phone) alongside text.sendReaction()
Send a tapback reaction to a specific message. Requires the Private API.
The reaction type. Must be one of:
"love", "like", "dislike", "laugh", "emphasize", "question", or the removal prefix variants: "-love", "-like", "-dislike", "-laugh", "-emphasize", "-question".The part index of the message to react to. Useful for messages with multiple parts (e.g. mixed text and images). Defaults to
0. Requires macOS Big Sur+.Querying messages
list()
Query messages from the database with filtering, pagination, and sorting.
Related data to include. Accepted values:
"chat", "chat.participants", "attachment", "handle", "sms", "attributed-body", "message-info-summary", "payload-data".TypeORM WHERE expression clauses for granular filtering. Each entry is an object with a
statement string and an args dictionary.get()
Fetch a single message’s full database record by its GUID.
getUpdatedMessageCount()
Get the total number of messages stored for your iMessage account on the server device.
getMySentMessageCount()
Get the total number of messages you have personally sent from your iMessage account.
Scheduled messages
scheduleAMessage()
Schedule a message to be sent at a future time, either once or on a recurring interval. Requires BlueBubbles Server v1.4.0+.
The message data to send at the scheduled time. Mirrors the
sendText() request body — include chatGuid, message, and optionally method.Milliseconds-since-epoch timestamp for when the message should be sent. Must be a future timestamp.
Scheduling configuration. For a one-time message, set
{ "type": "once" }. For recurring, set { "type": "recurring", "intervalType": "daily" | "hourly" | "weekly" | "monthly" | "yearly", "interval": number }.