This is separate from an admin-global pin, which is managed from the
CometChat Dashboard and shows for every user. Those
cannot be created or removed from the SDK, only observed.
Pin a Conversation
A conversation is addressed by its peer — the other user’s UID for a one-on-one conversation, or the GUID for a group — together with the conversation type.- TypeScript
- JavaScript
Conversation, with pinnedAt and pinnedBy set. Pinning is idempotent.
Addressing by peer rather than by
conversationId is deliberate: it lets you
pin a conversation that has no messages yet.Unpin a Conversation
- TypeScript
- JavaScript
ERR_ACTION_NOT_ALLOWED. Hide or disable the unpin control for conversations you know are system-pinned.
Fetch Pinned Conversations
The default conversation list is already pin-ordered by the server: admin-global pins first, then the user’s own pins, then everything else. Fetch it as you normally would and no extra filter is needed. To narrow the list to pins only, usesetPinnedBy() with the tokens on CometChat.PINNED_BY.
- TypeScript
- JavaScript
Passing an empty array is the same as not calling
setPinnedBy() at all — you get the default, pin-ordered list.
Check if a Conversation is Pinned
- TypeScript
- JavaScript
pinnedAt is the boolean — an unpinned conversation has no pin attributes at all.
Real-time Conversation Pin Events
Conversation pins arrive on a dedicatedConversationListener, not on MessageListener — the payload is a Conversation, not a message.
- TypeScript
- JavaScript
- TypeScript
- JavaScript
Pin Limit
- TypeScript
- JavaScript
null when the app settings carry no value. getSystemPinnedConversationsLimit() is the separate admin/global cap, enforced independently.
Feature Availability
- TypeScript
- JavaScript
Next Steps
Retrieve Conversations
Fetch and order the conversation list
Pin A Message
Highlight a message for everyone in a conversation
Save A Message
Bookmark a message privately, across conversations
All Real Time Listeners
Every listener the SDK exposes, in one place