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.
The GUID of the chat to send the message to, e.g.
"iMessage;+;+15550001234".The text content of the message.
A client-generated unique identifier used to deduplicate messages and prevent duplicates.
Send method. One of
"apple-script" (default) or "private-api". Using subject, effectId, or selectedMessageGuid forces "private-api" automatically.Optional message subject line. Requires Private API.
iMessage effect identifier (e.g.
"com.apple.MobileSMS.expressivesend.invisibleink"). Requires Private API.GUID of the message to reply to. 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.
The GUID of the target chat.
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.Optional subject line for the message.
iMessage effect identifier.
GUID of the message this is a reply to.
Part index of the message to reply to. Defaults to
0.sendReaction()
Send a tapback reaction to a specific message. Requires the Private API.
The GUID of the chat containing the message to react to.
The GUID of the message you want to react to.
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.
Maximum number of messages to return. Defaults to
1000.Number of records to skip. Use with
limit for pagination. Defaults to 0.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.Return only messages after this UNIX timestamp (seconds since epoch).
Return only messages before this UNIX timestamp (seconds since epoch).
Sort direction for results. One of
"ASC" or "DESC".get()
Fetch a single message’s full database record by its GUID.
The GUID of the message to retrieve.
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 action type. Currently only
"send-message" is supported.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 }.getScheduledMessages()
Retrieve all scheduled messages, including past and currently pending ones.
getScheduledMessageById()
Retrieve a single scheduled message by its ID.
The unique ID of the scheduled message.
updateAScheduledMessageById()
Update the payload, schedule time, or recurrence configuration of an existing scheduled message.
The unique ID of the scheduled message to update.
Action type. Use
"send-message".Updated message payload mirroring the
sendText() body.New milliseconds-since-epoch timestamp for when the message should send.
Updated schedule configuration. Same shape as
scheduleAMessage().deleteScheduledMessageById()
Permanently delete a scheduled message by its ID.
The unique ID of the scheduled message to delete.