AI Integration Quick Reference
AI Integration Quick Reference
savedAt is per-viewer. It is only ever populated in the acting user’s own
context — you will never see another user’s saves on a message, so the same
message reads saved for one user and unsaved for everyone else.Save a Message
CallsaveMessage() with the message’s ID. It resolves with the full updated message, with savedAt set.
- TypeScript
- JavaScript
errorParams.limit.
Unsave a Message
- TypeScript
- JavaScript
savedAt cleared, never left stale.
Fetch Saved Messages
Build aMessagesRequest with setSavedOnly(true). The saved list is user-level, so unlike the pinned list you do not set a UID or a GUID — leaving both unset is what makes it cross-conversation.
- TypeScript
- JavaScript
setLimit is 30 and the max value is 100.
The list comes back newest save first. Call fetchPrevious() again on the same object to page through older entries — this filter changes what the list contains, not how it pages.
Because the list spans conversations, every row carries its own context — use getConversationId(), getReceiverId() and getReceiverType() to route a tap on a saved message back to the right conversation.
- TypeScript
- JavaScript
Check if a Message is Saved
The React Native SDK has noisSaved() helper — the presence of savedAt is the boolean, and an unsaved message simply has no save attribute.
- TypeScript
- JavaScript
Real-time Save Events
Save and unsave are private multi-device events: they are delivered to the user’s other logged-in sessions so a save on the phone shows up on the desktop. Add the callbacks to your existingMessageListener.
- TypeScript
- JavaScript
These callbacks fire for saves made on your other devices, not the one that
performed the save — that device already has the message resolved from
saveMessage(). Update your saved list from the promise there, and from these
callbacks everywhere else.Save Limit
A user may save a capped number of messages across all conversations. Read the cap from app settings rather than hard-coding it.- TypeScript
- JavaScript
null when the app settings carry no value — show generic copy in that case rather than guessing a number.
Feature Availability
- TypeScript
- JavaScript
false rather than rejecting when the flag is missing or settings are unavailable.
Offline Behaviour
With offline support enabled, passing aMessageFetchListener to fetchPrevious() or fetchNext() on a setSavedOnly(true) request calls onCachedMessages first (even when the page is empty) and then onServerMessages with the live list. Offline, the read ends with onError (FAILED_TO_FETCH) after the cached page, and the Promise rejects. onCachedMessages holds the user’s cached saved messages across all conversations. The saved list is answered from its own store, so other MessagesRequestBuilder filters are ignored in the cached page.
Next Steps
Pin A Message
Highlight a message for everyone in a conversation
Pin A Conversation
Pin a conversation to the top of the list
Retrieve Conversations
Fetch and order the conversation list
Additional Message Filtering
Filter messages by saved, pinned, type, tags and more