Skip to content

messages_pinned

messages_pinned returns every pinned message in a channel or thread, newest first. Use it to show a pins panel.

{
"cmd": "messages_pinned",
"channel": "general"
}
Field Type Required Description
channel string One of channel or thread_id Channel name.
thread_id string One of channel or thread_id Thread ID. If you also send channel, it must be the thread’s parent.
{
"cmd": "messages_pinned",
"channel": "general",
"messages": [
{
"id": "7d0e4c1a-5b8f-4b0e-8f55-2d3c9a61e7b4",
"user": "alice",
"author_id": "<alice's user ID>",
"timestamp": 1788940000.31,
"content": "Release notes are up: https://example.com/changelog",
"pinned": true
}
]
}
  • messages holds message objects, newest first.
  • An entry is null when its author is severed from you. Skip those entries.
  • There is no paging; you get every pin at once.
  • A thread response has thread_id, and channel is the thread’s parent.

Keep the list current with the message_pin and message_unpin events.

You must be able to view the channel, or the thread’s parent channel.

val When
Channel or thread_id not provided You sent neither channel nor thread_id.
Channel not found The channel doesn’t exist.
Thread not found No thread has this ID.
Thread does not belong to this channel channel is not the thread’s parent.
You do not have permission to view this thread You can’t view the thread’s parent channel.
Messages must be sent inside a thread in forum channels channel is a forum and you sent no thread_id.
This channel does not support chat channel is a separator.
Access denied to this channel You can’t view the channel.