client.messages to send every kind of iMessage your app might need — from a plain text string to richly formatted multipart messages with inline mentions and attachments. Each method maps directly to a BlueBubbles Server REST endpoint, so the behavior you see in the API reference applies here too.
Send a text message
UsesendText() to send a plain text iMessage to any chat. At minimum you need the target chat’s GUID, a temporary deduplication ID, and the message body.
All parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
chatGuid | string | Yes | The GUID of the target chat, e.g. iMessage;+;+15551234567 |
tempGuid | string | Yes | A unique ID you generate to prevent duplicate sends |
message | string | Yes | The text content to send |
method | string | No | apple-script (default) or private-api |
subject | string | No | Message subject line — forces private-api |
effectId | string | No | iMessage bubble/screen effect ID — forces private-api |
selectedMessageGuid | string | No | GUID of the message to reply to — forces private-api |
partIndex | number | No | The part index of selectedMessageGuid to reply to (default 0). Requires macOS Big Sur+ and server v1.4.0 |
The
subject, effectId, and selectedMessageGuid parameters all require the Private API to be enabled on your BlueBubbles Server. Passing any of them will automatically override method to private-api. You can also pass "method": "private-api" explicitly.Send a reply
To reply to a specific message, passselectedMessageGuid with the GUID of the message you want to thread under:
Send with an effect
Pass any valid iMessage effect ID ineffectId to apply a bubble or screen effect:
Send an attachment
UsesendAttachment() to send a file directly to a chat. Pass a multipart form body containing the file and the target chatGuid.
sendAttachment() conditionally uses the Private API when method: "private-api", subject, effectId, or selectedMessageGuid are included in the request body. Requires BlueBubbles Server 0.3.0+.Send a multipart message
sendMultipartMessage() lets you combine text, mentions, and pre-uploaded attachments in a single send. Each element in the parts array represents one segment of the message.
Before including an attachment in a multipart message, you must upload it first using
client.attachments.uploadAttachment(). See the Attachments guide for details.Parts array rules
- Every element must be a plain object with a
partIndex(starting at0, incrementing by1) - Each part must have either
textorattachment— not both - Parts with
attachmentmust also include aname(the filename) - Attachment values must be UUIDs returned by
uploadAttachment(), not file paths - Mention parts must include a
textlabel alongside thementionaddress
subject, effectId, and selectedMessageGuid at the top level to use Private API features.
Send a reaction
UsesendReaction() to tapback any message — loves, thumbs up, questions, and so on. This always requires the Private API.
sendReaction() requires the Private API to be enabled on your BlueBubbles Server. Requires server version 0.3.0+. The partIndex parameter requires macOS Big Sur+ and server v1.4.0.Valid reaction values
| Value | Description |
|---|---|
love | Heart |
like | Thumbs up |
dislike | Thumbs down |
laugh | Ha ha |
emphasize | Exclamation |
question | Question mark |
-love | Remove heart |
-like | Remove thumbs up |
-dislike | Remove thumbs down |
-laugh | Remove ha ha |
-emphasize | Remove exclamation |
-question | Remove question mark |
- to remove it.
partIndex to react to a specific segment within a multipart message. For standard single-part messages, omit it or pass 0.