Zernio
Zernio
API Reference

Discord

Settings

Get Discord account settingsGETUpdate Discord settingsPATCHList Discord guild channelsGET

Messaging

Send a Discord Direct MessagePOSTList pinned messagesGETPin a Discord messagePUTUnpin a Discord messageDELETECreate a Discord public threadPOSTCrosspost Discord messagePOSTDelete a Discord channel messageDELETE

Roles & Members

List Discord guild rolesGETCreate a Discord guild rolePOSTEdit a Discord guild rolePATCHDelete a Discord guild roleDELETEList Discord guild membersGETSearch Discord guild membersGETGet a Discord guild memberGETAssign a role to a guild memberPUTRemove a role from a guild memberDELETE

Scheduled Events

List Discord scheduled eventsGETCreate a Discord scheduled eventPOSTGet a Discord scheduled eventGETUpdate a Discord scheduled eventPATCHDelete a Discord scheduled eventDELETE
Dashboard
llms.txtOpenAPI
OverviewPlatformsAPI ReferenceResources
Discord

Send a Discord Direct Message

Send a 1:1 Direct Message from the bot to a Discord user (by snowflake ID). Supports the same payload shape as channel posts: content, embeds, media attachments, and TTS.

Constraints (Discord platform limits):

  • The bot can only DM users it shares at least one guild with.
  • If the recipient has DMs disabled for non-friends, Discord returns 403 (surfaces as a 502 platform error).
  • content capped at 2,000 chars.
  • At least one of content, embeds, or attachments is required.
  • The recipient must be identified by Discord snowflake ID (not username).

This is a dedicated endpoint rather than a POST /v1/posts variant because DMs are 1:1 operational messages (onboarding, billing reminders, support pings) with a different lifecycle than scheduled channel posts. DMs are not persisted to Post / ExternalPost and are always sent immediately.


POST
/v1/discord/dms

Authorization

bearerAuth
AuthorizationBearer <token>

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

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.sendDiscordDirectMessage({  body: {    accountId: '65a1b2c3d4e5f60718293a4b',    userId: '1234567890123456789',  },});console.log(data);
{  "messageId": "1357924680135792468",  "channelId": "1357924680135792467",  "url": "https://discord.com/channels/@me/1357924680135792467/1357924680135792468",  "timestamp": "2026-06-02T12:34:56.789Z",  "recipient": {    "userId": "1234567890123456789",    "platform": "discord"  },  "account": {    "id": "65a1b2c3d4e5f60718293a4b",    "username": "announcements",    "displayName": "My Server - #announcements"  }}
Was this page helpful?

List Discord guild channels

Returns the text, announcement, and forum channels in the connected Discord guild. Use this to discover available channels when switching the connected channel via PATCH /v1/accounts/{accountId}/discord-settings.

List pinned messages

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).

accountId*string

SocialAccount _id of the connected Discord account the bot speaks as. Caller must own the account (directly or via team membership).

userId*string

Discord snowflake ID of the recipient (15-21 digits).

content?string

Message text, up to 2,000 characters.

Lengthlength <= 2000
embeds?array<>

Up to 10 Discord embeds. Same shape as channel-post embeds (title, description, color, fields, etc.). See DiscordPlatformData.embeds for the embed object schema.

Itemsitems <= 10
attachments?array<>

Up to 10 media attachments. Each is { type: image|video|gif|document, url, filename?, mimeType?, size? }.

Itemsitems <= 10
tts?boolean

Send as text-to-speech message.