discord
Pin a Discord message
Pin a specific message in a channel. Path shape mirrors Discord's own
API (PUT /channels/{cid}/pins/{mid}).
Idempotent — re-pinning an already-pinned message is a 204 no-op.
Constraints:
- Bot needs MANAGE_MESSAGES in the channel.
- 50-pin cap per channel — hitting it returns 400 (Discord-side). Caller should unpin one first.
AuthorizationBearer <token>
API key authentication - use your Zernio API key as a Bearer token
In: header
Path Parameters
channelIdstring
messageIdstring
Query Parameters
accountIdstring
Response Body
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.discord.pinDiscordMessage({ path: { channelId: 'channel_abc123', messageId: 'message_abc123', }, query: { accountId: 'account_abc123', },});console.log(data);{
"success": true,
"operation": "message_pinned",
"channelId": "string",
"messageId": "string"
}Empty
{
"error": "Unauthorized"
}Empty
Empty
List pinned messages GET
Returns the channel's pinned messages, sorted most-recently-pinned first. Discord caps a channel at 50 pinned messages and returns the full list unpaginated. Bot needs READ_MESSAGE_HISTORY in the channel (granted by default BOT_PERMISSIONS).
Unpin a Discord message DELETE
Unpin a message. Same MANAGE_MESSAGES permission requirement as pin. Idempotent — unpinning a non-pinned message is a 204 no-op.