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, 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

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.
A just-sent message may not be pinnable or savable yet. On an app with moderation enabled, the server stamps a new message moderation.status: "pending" and clears it to "approved" a moment later. While it is pending, pinMessage() rejects with 403 ERR_MESSAGE_NO_ACCESS — the same code it returns for a genuine permission refusal, so you cannot tell the two apart from the error alone.Measured on a moderated app, the window runs from send, not from the user’s tap, and clears within a few seconds. Do not disable the control on this error: by the time someone opens a menu and taps, moderation has usually finished. Prefer a retry or a transient “not ready yet” message over telling the user they lack permission. Moderation is configured per app, so this never reproduces on an app that has it switched off.
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

Any Admin, Moderator or Owner may unpin — not only whoever pinned it. 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 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.
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. The default value for 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

Every BaseMessage 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.
Do not port isPinned() or isSystemPinned() from the JavaScript SDK — they do not exist in the React Native SDK. Derive both from getPinnedAt() and getPinnedBy() as shown above.

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 getPinnedAt() and getPinnedBy() are readable without a follow-up fetch — replace the message in your list directly. Remove the listener when the screen unmounts:

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. 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.
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