Skip to main content
The 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.
string
required
The GUID of the chat to send the message to, e.g. "iMessage;+;+15550001234".
string
required
The text content of the message.
string
A client-generated unique identifier used to deduplicate messages and prevent duplicates.
string
Send method. One of "apple-script" (default) or "private-api". Using subject, effectId, or selectedMessageGuid forces "private-api" automatically.
string
Optional message subject line. Requires Private API.
string
iMessage effect identifier (e.g. "com.apple.MobileSMS.expressivesend.invisibleink"). Requires Private API.
string
GUID of the message to reply to. Requires Private API.
number
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.
any
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.
string
required
The GUID of the target chat.
array
required
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.
string
Optional subject line for the message.
string
iMessage effect identifier.
string
GUID of the message this is a reply to.
number
Part index of the message to reply to. Defaults to 0.
You must upload each attachment with AttachmentsService.uploadAttachment() first and use the returned UUID hash as the attachment value in each part.

sendReaction()

Send a tapback reaction to a specific message. Requires the Private API.
string
required
The GUID of the chat containing the message to react to.
string
required
The GUID of the message you want to react to.
string
required
The reaction type. Must be one of: "love", "like", "dislike", "laugh", "emphasize", "question", or the removal prefix variants: "-love", "-like", "-dislike", "-laugh", "-emphasize", "-question".
number
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+.
sendReaction() requires the Private API to be enabled on your BlueBubbles Server. Minimum server version: 0.3.0.

Querying messages

list()

Query messages from the database with filtering, pagination, and sorting.
number
Maximum number of messages to return. Defaults to 1000.
number
Number of records to skip. Use with limit for pagination. Defaults to 0.
array
Related data to include. Accepted values: "chat", "chat.participants", "attachment", "handle", "sms", "attributed-body", "message-info-summary", "payload-data".
array
TypeORM WHERE expression clauses for granular filtering. Each entry is an object with a statement string and an args dictionary.
number
Return only messages after this UNIX timestamp (seconds since epoch).
number
Return only messages before this UNIX timestamp (seconds since epoch).
string
Sort direction for results. One of "ASC" or "DESC".

get()

Fetch a single message’s full database record by its GUID.
string
required
The GUID of the message to retrieve.

getUpdatedMessageCount()

Get the total number of messages stored for your iMessage account on the server device.
This method takes no parameters.

getMySentMessageCount()

Get the total number of messages you have personally sent from your iMessage account.
This method takes no parameters.

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+.
string
required
The action type. Currently only "send-message" is supported.
object
required
The message data to send at the scheduled time. Mirrors the sendText() request body — include chatGuid, message, and optionally method.
number
required
Milliseconds-since-epoch timestamp for when the message should be sent. Must be a future timestamp.
object
required
Scheduling configuration. For a one-time message, set { "type": "once" }. For recurring, set { "type": "recurring", "intervalType": "daily" | "hourly" | "weekly" | "monthly" | "yearly", "interval": number }.
Missed one-time messages are not retried. If the server was offline at the scheduled time, the message will be dropped. Missed recurring messages are rescheduled to the next occurrence.

getScheduledMessages()

Retrieve all scheduled messages, including past and currently pending ones.
This method takes no parameters. Requires BlueBubbles Server v1.4.0+.

getScheduledMessageById()

Retrieve a single scheduled message by its ID.
string
required
The unique ID of the scheduled message.
Requires BlueBubbles Server v1.4.0+.

updateAScheduledMessageById()

Update the payload, schedule time, or recurrence configuration of an existing scheduled message.
string
required
The unique ID of the scheduled message to update.
string
Action type. Use "send-message".
object
Updated message payload mirroring the sendText() body.
number
New milliseconds-since-epoch timestamp for when the message should send.
object
Updated schedule configuration. Same shape as scheduleAMessage().
Requires BlueBubbles Server v1.4.0+.

deleteScheduledMessageById()

Permanently delete a scheduled message by its ID.
string
required
The unique ID of the scheduled message to delete.
Requires BlueBubbles Server v1.4.0+.