Skip to main content
Pinning a conversation keeps it at the top of the logged-in user’s conversation list. The pin is private to that user — nobody else sees it — and it syncs to their other devices.
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.
It resolves with the full updated 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

A user cannot unpin an admin-global pin — that call is rejected with 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, use setPinnedBy() with the tokens on CometChat.PINNED_BY.
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

As with messages, the presence of pinnedAt is the boolean — an unpinned conversation has no pin attributes at all.

Real-time Conversation Pin Events

Conversation pins arrive on a dedicated ConversationListener, not on MessageListener — the payload is a Conversation, not a message.
These fire both when the logged-in user pins from another device and when an admin pins globally. Remove the listener when you are done:

Pin Limit

Both resolve to null when the app settings carry no value. getSystemPinnedConversationsLimit() is the separate admin/global cap, enforced independently.

Feature Availability


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