Discord
MessagingPublish messages, embeds, polls, forum posts and threads to Discord channels with the Zernio API, send DMs, manage roles and pins, and create scheduled events, with no bot hosting.
Authentication details
Connecting accounts guideOAuth 2.0 (Bot)
Connect endpoints
POST /v1/connect/discordConnect a Discord channel
Permissions2 scopes
- Always requested
Publish messages, embeds, polls, forum posts and threads to a Discord channel with POST /v1/posts and platform: "discord".
The same bot sends DMs, lists members, assigns roles, pins messages and creates scheduled events, all over REST.
Quick reference
| Property | Value |
|---|---|
| Content limit | 2,000 characters (message content) |
| Embeds per message | 10 (max 6,000 characters total) |
| Images per message | Up to 10 attachments |
| Image formats | JPEG, PNG, GIF, WebP |
| Image max size | 20 MiB default (higher on Boosted servers) |
| Video formats | MP4 |
| Video max size | 20 MiB default (higher on Boosted servers) |
| Post types | Messages, Embeds, Polls, Forum Posts, Threads |
| Scheduling | Yes |
| Direct messages | Outbound only |
| Role management | Yes (list, create, edit, delete, assign, remove) |
| Member listing | Yes (list with cursor pagination, search, get one) |
| Pinned messages | Yes (list, pin, unpin) |
| Scheduled events | Yes (create, list, update, cancel, delete) |
| Inbox (DM replies) | No (Discord requires a Gateway connection) |
| Inbox (comments) | No |
| Analytics | No (Discord Bot API limit) |
Before you start
Discord requires Zernio's bot in your server. You do not create a Discord application, request privileged intents or host a gateway connection.
Zernio runs one central bot. The user installs it into their server through OAuth, and you POST to the REST API.
MESSAGE_CONTENT and the other privileged intents are handled on Zernio's bot, and you never open a WebSocket.
The bot asks for these permissions at install time:
- Send Messages
- Embed Links
- Attach Files
- Send Messages in Threads
- Create Public Threads
- Manage Messages (pin and unpin)
- Manage Roles (role assignment)
- Manage Events (scheduled events)
Servers connected before Manage Roles and Manage Events were added to the install do not have them, so the role and event endpoints return 502 there.
Ask a server admin to re-invite the bot (the new permissions come with the invite) or to grant the missing permission on the bot's role under Server Settings, Roles.
Connect
Call GET /v1/connect/discord with profileId on Get OAuth connect URL. The user authorizes the bot to join their server.
You then bind a channel with POST /v1/connect/discord (Connect Discord channel).
The full flow, with code for every step, is on Connect.
Publish a post
This request sends a message to a Discord channel right away. platformSpecificData.channelId picks the channel.
const { data: published } = await zernio.posts.createPost({
body: {
content: 'Release 2.3 is live. Changelog in the thread below.',
platforms: [
{
platform: 'discord',
accountId: '66b2e19d8c3f5a7e9d0b1c2d',
platformSpecificData: { channelId: '1234567890123456789' }
}
],
publishNow: true
}
});
console.log(published.post.platforms[0].platformPostUrl);Every option is on Publish.
In this section
Connect
Connect a Discord account with the Zernio API, every step with code.
Publish
Publish messages, embeds, polls, forum posts and threads to a Discord channel, and edit or delete them.
Platform fields & media
Every Discord platformSpecificData field and the attachment requirements.
Inbox
Send 1:1 Discord direct messages from the bot.
Server management
Manage channels, roles, members, pinned messages and scheduled events in the bot's Discord server.
Limits & errors
Analytics availability, what Discord's API does not expose and the common errors when publishing.
Related
- Connecting accounts: the OAuth flow and bot installation.
- Create post: every field of the request.
- Discord settings and Discord channels: webhook identity and channel switching.
- Send Discord DM: 1:1 messages from the bot.
- Pricing: what outbound DMs cost.
Discord
25- POST
- GET
- PATCH
- GET
- POST
- GET
- POST
- PATCH
- DELETE
- GET
- GET
- GET
Publishing
24· Unified API, shared with other platforms- POST
- POST
- POST
- POST
- GET
- POST
- GET
- PUT
- DELETE
- POST
- POST
- POST