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.
API key authentication - use your Zernio API key as a Bearer token
In: header
Path Parameters
Query Parameters
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"
}{
"error": "Unauthorized"
}Assign a role to a guild member PUT
Assign one role to one member. Idempotent on Discord's side — re-running on a member who already has the role is a 204 no-op. Path shape mirrors Discord's own API (`PUT /guilds/{guild}/members/{user}/roles/{role}`) for zero-translation mental mapping. Bot needs MANAGE_ROLES permission in the guild AND its highest role must be above the target role (Discord hierarchy rule). The `@everyone` role (where roleId == guildId) cannot be assigned.
Remove a role from a guild member DELETE
Remove one role from one member. Idempotent — removing a role the member doesn't have returns 204 no-op. Same permission + hierarchy constraints as the PUT counterpart.