Pinned Messages
Overview
Retrieve pinned messages for a conversation - for the pinned banner at the top of the chat thread and the full pinned-messages list in the messaging UI.
Each row wraps the underlying message (text or media preview) with who pinned it and when, so you can show a compact banner or a scrollable pinned panel without loading the entire message history.
When to use this endpoint?
Use Pinned Messages when:
- Rendering the pinned-message banner above the chat input when a conversation has active pins.
- Opening a "Pinned messages" sheet or modal from the thread header menu.
- Refreshing pin state after a user pins or unpins a message via socket or action API.
- Showing who pinned each message and when for group transparency.
Part of the Chat Messages APIs for the chat package/SDK (not Platform → Messages). Requires a chat user Access Token for the signed-in messaging participant.
Response Data
Each item in data.list typically includes:
{baseUrl}/api/{apiVersion}/message/pinned-messages?conversationId={conversationId}&page=1&limit=15&sort=createdAt&sortType=desc- Authentication
- Required (Bearer token)
- Tenant-scoped
- Yes (tenant DB - requires x-client-id)
Request Headers
Query Parameters
Success Response (HTTP 200 OK)
On success, the API returns a list of pin records. Use messageId for preview text or thumbnails in the pinned banner; use pinnedBy and pinnedAt for attribution.
{ "success": true, "message": "Pinned messages fetched successfully", "data": { "list": [ { "messageId": { "_id": "69786e9583a5ab2f5e986a87", "content": "hello", "type": "text", "status": "read" }, "pinnedBy": { "_id": "694bac9cd60aff7378ddc77a", "name": "test 3 user" }, "pinnedAt": "2026-01-27T10:41:24.618Z", "_id": "697896549266218f5eec5014" }, { "messageId": { "_id": "6979b8c271b296d1ac960536", "type": "image", "attachmentUrl": "https://fastly.picsum.photos/id/237/200/300.jpg?hmac=TmmQSbShHz9CdQm0NkEjx1Dyh_Y984R9LpNrpvH2D_U", "status": "read" }, "pinnedBy": { "_id": "694bac9cd60aff7378ddc77a", "name": "test 3 user" }, "pinnedAt": "2026-01-28T07:44:33.308Z", "_id": "6979be6171b296d1ac96057b" } ] }, "error": null}Common Errors
Pinned list fails when the token is missing, the user is not a participant, or the conversation does not exist in this tenant.
HTTP 401 Unauthorized - No token
{ "success": false, "message": "No token, authorization denied", "data": null, "error": "Unauthorized"}HTTP 403 Forbidden - Access denied
{ "success": false, "message": "Access denied: insufficient permissions", "data": null, "error": null}HTTP 404 Not Found - Conversation not found
{ "success": false, "message": "Conversation not found", "data": null, "error": null}Best Practices
- Fetch on thread open alongside List Messages when
pinnedCountfrom the conversation list is greater than zero. - Show the most recent pin in a compact banner; link to the full list when multiple pins exist.
- On pin/unpin socket events, patch local state or refetch this endpoint instead of reloading the entire message history.
- Use
messageId._idto scroll to the original message in the thread when the user taps a pinned row. - Always send tenant headers with the chat user Bearer token over HTTPS.
Pins ready
Bind the list to your pinned banner and pinned-messages panel. Pair with List Messages so tapping a pin scrolls to the message in the active thread.