List Discord guild roles
Returns all roles in a Discord guild. Useful for building role-mention pickers, role-permission UIs, or finding the role ID before calling the role-assign endpoint.
Roles are returned unordered — sort client-side by position if you
need Discord's UI ordering.
Caller must pass accountId of a Discord SocialAccount bound to this
guild (route verifies team access + guild match).
API key authentication - use your Zernio API key as a Bearer token
In: header
Path Parameters
Discord guild snowflake ID
Query Parameters
SocialAccount _id of the Discord account bound to this guild
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.listDiscordGuildRoles({ path: { guildId: 'guild_abc123', }, query: { accountId: 'account_abc123', },});console.log(data);{
"data": [
{
"id": "string",
"name": "string",
"color": 0,
"position": 0,
"permissions": "string",
"managed": true,
"mentionable": true,
"hoist": true
}
]
}{
"error": "Unauthorized"
}List Discord guild members GET
Cursor-paginated list of guild members. Returns Discord's raw member objects so callers can build community-ops automation (e.g. "add role to all members joined in the last 7 days") on the actual platform shape. **Important:** this endpoint requires the privileged "Server Members Intent" enabled on the Discord app (Developer Portal → Bot tab → toggle "Server Members Intent" ON, then Save). Without it, Discord returns an empty array with no error. Verify the intent is enabled before relying on this endpoint. Pagination: pass `after` = the last `user.id` from the previous page. Omit on the first call. Response includes a `nextCursor` and `hasMore` flag so callers don't need to know Discord's pagination shape.
List pinned messages in a Discord channel 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).