AI Integration Quick Reference
AI Integration Quick Reference
Pinning is a moderation action. Only an Admin, Moderator or group Owner may pin
or unpin. The server is the authority: a member’s call is rejected with
ERR_ACTION_NOT_ALLOWED.Pin a Message
CallpinMessage() with the message’s ID. It resolves with the full updated message, with pinnedAt and pinnedBy set.
- TypeScript
- JavaScript
pinnedBy and pinnedAt to the most recent pinner rather than failing.
On a cap breach the rejection carries the server-owned ceiling in
errorParams.limit, so you can tell the user the actual number without a
second call.Unpin a Message
- TypeScript
- JavaScript
Fetch Pinned Messages
Build aMessagesRequest with setPinnedOnly(true). A pinned list belongs to one conversation, so pair it with setUID() for a one-on-one conversation or setGUID() for a group — exactly one of the two is required.
- TypeScript (User)
- JavaScript (User)
- TypeScript (Group)
- JavaScript (Group)
setLimit is 30 and the max value is 100.
Page it like any other message list: fetchPrevious() for older rows, fetchNext() for newer, stopping when a call resolves []. The one difference is invisible to you — the cursor rides on pinnedAt instead of sentAt, and the SDK swaps it for you.
Check if a Message is Pinned
EveryBaseMessage carries its pin state as attributes. The React Native SDK has no isPinned() helper — the presence of pinnedAt is the boolean, and an unpinned message simply has no pin attributes.
- TypeScript
- JavaScript
Real-time Pin Events
Pin and unpin are broadcast to everyone in the conversation. Add the callbacks to your existingMessageListener.
- TypeScript
- JavaScript
getPinnedAt() and getPinnedBy() are readable without a follow-up fetch — replace the message in your list directly.
Remove the listener when the screen unmounts:
- TypeScript
- JavaScript
Pin Limit
A conversation holds a capped number of pins, configurable per app. Read the cap rather than hard-coding it — it is tenant-overridable and will drift.- TypeScript
- JavaScript
null when the app settings carry no value — show generic copy in that case rather than guessing a number. getSystemPinMessageLimit() is the separate cap for admin/global pins: system pins do not consume a user’s allowance, so the two budgets are enforced independently.
Feature Availability
Check whether Pin Message is enabled for your app before showing pin actions.- TypeScript
- JavaScript
false rather than rejecting when the flag is missing or settings are unavailable, so an unavailable setting degrades to “hidden” instead of an unhandled rejection.
Next Steps
Save A Message
Bookmark a message privately, across conversations
Pin A Conversation
Pin a conversation to the top of the list
All Real Time Listeners
Every listener the SDK exposes, in one place
Additional Message Filtering
Filter messages by pinned, saved, type, tags and more