getMessage
Retrieve a single message by its GUID.Method Signature
Parameters
The unique identifier of the message to retrieve
Array of related entities to include in the responseOptions:
"handle"- Include sender/recipient information"chats"- Include chat information"attachments"- Include attachment data
Example
getMessages
Query and retrieve multiple messages with filtering and pagination.Method Signature
Parameters
Filter messages to a specific chat
Number of messages to skip (for pagination)
Maximum number of messages to return
Sort order by creation date
"ASC"- Oldest first"DESC"- Newest first
Only return messages created before this timestamp (milliseconds since epoch)
Only return messages created after this timestamp (milliseconds since epoch)
Array of related entities to include. Options:
"handle", "chats", "attachments"Examples
Get Recent Messages from a Chat
Paginate Through Messages
Get Messages from Last 24 Hours
Get Messages in Date Range
searchMessages
Search for messages containing specific text.Method Signature
On macOS 13+, search uses Spotlight API with token-based matching. Word boundaries matter: “Hello” matches “Hello world” but “Hell” does not match “Hello”.
Parameters
Search query text. Cannot be empty. Uses token-based matching on macOS 13+.
Limit search to a specific chat
Number of results to skip
Maximum number of results to return
Sort order by creation date
Only search messages before this timestamp
Only search messages after this timestamp
Examples
Basic Search
Search Within a Chat
Search with Date Range
getMessageCount
Get the total count of messages matching specific criteria.Method Signature
Parameters
Count messages created after this timestamp
Count messages created before this timestamp
Count messages in a specific chat
Minimum database row ID
Maximum database row ID
Examples
Count All Messages
Count Messages in Chat
Count Recent Messages
Response Format
All methods (exceptgetMessageCount) return MessageResponse objects with the following key fields:
Unique message identifier
Message text content
Creation timestamp (milliseconds since epoch)
Read timestamp, or null if unread
Delivery timestamp, or null if not delivered
Whether the message was sent by you
Sender/recipient information (if included with
with parameter)Associated chats (if included with
with parameter)Attached files (if included with
with parameter)Last edit timestamp, or null if never edited
Related Methods
- sendMessage - Send a new message
- editMessage - Edit an existing message
- unsendMessage - Unsend a message
getUpdatedMessageCount
Get the count of messages that have been updated (edited, reacted to, etc.).Method Signature
Parameters
Count updated messages after this timestamp
Count updated messages before this timestamp
Count updated messages in a specific chat
Minimum database row ID
Maximum database row ID
Example
getSentMessageCount
Get the count of messages you have sent.Method Signature
Parameters
Count sent messages after this timestamp
Count sent messages before this timestamp
Count sent messages in a specific chat
Minimum database row ID
Maximum database row ID
Example
notifyMessage
Trigger a notification for a specific message.Method Signature
Parameters
The unique identifier of the message to notify
Example
getEmbeddedMedia
Get embedded media (rich link preview, inline content) for a message.Method Signature
Parameters
The unique identifier of the message
Response
File path to the embedded media (if stored as file)
Base64-encoded embedded media data (if stored inline)