Skip to main content
Pinning highlights an important message in a conversation. A pin is conversation-wide and visible to everyone in that conversation, so it is the right tool for announcements, rules or a link everyone keeps asking for.
Pinning is a moderation action. Only an Admin or Moderator — a group owner included — may pin or unpin. The server is the authority: a member’s call is rejected with ERR_ACTION_NOT_ALLOWED.

Pin a Message

Call pinMessage() with the message’s ID. It resolves with the full updated message, with pinnedAt and pinnedBy set.
Pinning is idempotent, and a message has a single pinner: re-pinning an already pinned message updates pinnedBy and pinnedAt to the most recent pinner rather than failing.

Unpin a Message

The resolved message comes back with its pin attributes cleared, so you can swap the rendered message straight into your list.

Fetch Pinned Messages

Build a MessagesRequest with setPinned(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.
The list is ordered by pin time, most recently pinned first — not by when the messages were sent. Render it in the order the SDK returns it.
A conversation can hold at most 100 pinned messages, so setLimit(100) fetches the whole list in a single call — which is what you want when showing a pinned count in a header.

Check if a Message is Pinned

Every BaseMessage carries its pin state. The presence of pinnedAt is the boolean — an unpinned message simply has no pin attributes.

Real-time Pin Events

Pin and unpin are broadcast to everyone in the conversation. Add the callbacks to your existing MessageListener.
Each callback receives the full updated message, so you can replace the message in your list without a follow-up fetch.

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.
Both resolve to null when the app settings carry no value — show generic copy in that case rather than guessing a number. getSystemPinnedMessagesLimit() is the separate cap for admin/global pins, enforced independently of the per-user one.

Feature Availability

Check whether Pin Message is enabled for your app before showing pin actions.
This resolves 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